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)
| 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. |
| 30 | func 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. |
no outgoing calls
no test coverage detected
searching dependent graphs…