MCPcopy Index your code
hub / github.com/coder/coder / hashAddrorHostname

Method hashAddrorHostname

tailnet/telemetry.go:284–293  ·  view source on GitHub ↗
(addr string)

Source from the content-addressed store, hash-verified

282}
283
284func (b *TelemetryStore) hashAddrorHostname(addr string) string {
285 if hashStr, ok := b.hashCache[addr]; ok {
286 return hashStr
287 }
288
289 hash := sha256.Sum256([]byte(b.hashSalt + addr))
290 hashStr := hex.EncodeToString(hash[:])
291 b.hashCache[addr] = hashStr
292 return hashStr
293}
294
295func addrToFields(addr netip.Addr) *proto.IPFields {
296 version := int32(4)

Callers 4

updateDerpMapLockedMethod · 0.95
toEndpointMethod · 0.95
processIPLockedMethod · 0.95
TestTelemetryStoreFunction · 0.80

Calls

no outgoing calls

Tested by 1

TestTelemetryStoreFunction · 0.64