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

Function hashAdd

pkg/ingester/client/fnv.go:33–39  ·  view source on GitHub ↗

hashAdd adds a string to a fnv64a hash value, returning the updated hash. Note this is the same algorithm as Go stdlib `sum64a.Write()`

(h uint64, s string)

Source from the content-addressed store, hash-verified

31// hashAdd adds a string to a fnv64a hash value, returning the updated hash.
32// Note this is the same algorithm as Go stdlib `sum64a.Write()`
33func hashAdd(h uint64, s string) uint64 {
34 for i := 0; i < len(s); i++ {
35 h ^= uint64(s[i])
36 h *= prime64
37 }
38 return h
39}
40
41// hashAddByte adds a byte to a fnv64a hash value, returning the updated hash.
42func hashAddByte(h uint64, b byte) uint64 {

Callers 1

FastFingerprintFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected