MCPcopy Create free account
hub / github.com/codeexpress/respounder / randomHostname

Function randomHostname

respounder.go:205–213  ·  view source on GitHub ↗

Calculate random hostname by taking random length of the SHA1 of current time.

()

Source from the content-addressed store, hash-verified

203// Calculate random hostname by taking random length
204// of the SHA1 of current time.
205func randomHostname() string {
206 currentTime := time.Now().Format("2006-01-02 15:04:05")
207 h := sha1.New()
208 h.Write([]byte(currentTime))
209 bs := h.Sum(nil)
210 randomSlice := bs[:(rand.Intn(len(bs)-3) + 3)]
211 randomName := fmt.Sprintf("%x\n", randomSlice)
212 return randomName
213}
214
215// From all the IP addresses of this interface,
216// extract the IPv4 address where we'll bind to

Callers 1

sendLLMNRProbeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected