MCPcopy Create free account
hub / github.com/cortexproject/cortex / HashKey

Function HashKey

pkg/chunk/cache/memcached.go:267–273  ·  view source on GitHub ↗

HashKey hashes key into something you can store in memcached.

(key string)

Source from the content-addressed store, hash-verified

265
266// HashKey hashes key into something you can store in memcached.
267func HashKey(key string) string {
268 hasher := fnv.New64a()
269 _, _ = hasher.Write([]byte(key)) // This'll never error.
270
271 // Hex because memcache errors for the bytes produced by the hash.
272 return hex.EncodeToString(hasher.Sum(nil))
273}

Callers 3

getMethod · 0.92
putMethod · 0.92

Calls 1

WriteMethod · 0.45

Tested by 1