| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Data.PerfectHash.Hashing
Description
Implements the specialized hash function for this perfect hashing algorithm.
Documentation
This choice of prime number was taken from the Python implementation on Steve Hanov's page.
Arguments
| :: ToHashableChunks a | |
| => Int | nonce |
| -> a | key |
| -> Int |
Uses the "FNV-1a" algorithm from the FNV website:
hash = offset_basis
for each octet_of_data to be hashed
hash = hash xor octet_of_data
hash = hash * FNV_prime
return hashThe interface is comparable to the
hashWithSalt
function from the hashable package.