hash4 returns the hash of the lowest 4 bytes of u to fit in a hash table with h bits. Preferably h should be a constant and should always be <32.
(u uint64, h uint8)
| 14 | // hash4 returns the hash of the lowest 4 bytes of u to fit in a hash table with h bits. |
| 15 | // Preferably h should be a constant and should always be <32. |
| 16 | func hash4(u uint64, h uint8) uint32 { |
| 17 | const prime4bytes = 2654435761 |
| 18 | return (uint32(u) * prime4bytes) >> ((32 - h) & 31) |
| 19 | } |
| 20 | |
| 21 | // hash5 returns the hash of the lowest 5 bytes of u to fit in a hash table with h bits. |
| 22 | // Preferably h should be a constant and should always be <64. |
no outgoing calls
no test coverage detected
searching dependent graphs…