MCPcopy
hub / github.com/klauspost/compress / hash7

Function hash7

s2/encode_better.go:30–33  ·  view source on GitHub ↗

hash7 returns the hash of the lowest 7 bytes of u to fit in a hash table with h bits. Preferably h should be a constant and should always be <64.

(u uint64, h uint8)

Source from the content-addressed store, hash-verified

28// hash7 returns the hash of the lowest 7 bytes of u to fit in a hash table with h bits.
29// Preferably h should be a constant and should always be <64.
30func hash7(u uint64, h uint8) uint32 {
31 const prime7bytes = 58295818150454627
32 return uint32(((u << (64 - 56)) * prime7bytes) >> ((64 - h) & 63))
33}
34
35// hash8 returns the hash of u to fit in a hash table with h bits.
36// Preferably h should be a constant and should always be <64.

Callers 6

encodeBlockBetterGoFunction · 0.70
encodeBlockBetterGo64KFunction · 0.70
encodeBlockBetterDictFunction · 0.70
initBetterMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…