| Copyright | (c) Ville Vesilehto 2024 |
|---|---|
| License | MIT |
| Maintainer | ville@vesilehto.fi |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
ChibiHash
Contents
Description
ChibiHash is a simple and fast 64-bit hash function suitable for hash tables and hash-based data structures. This is a Haskell port of the original implementation by N-R-K at https://github.com/N-R-K/ChibiHash.
Example usage:
import ChibiHash (chibihash64)
import qualified Data.ByteString as BS
main :: IO ()
main = do
let input = BS.pack [1,2,3,4]
let seed = 0
print $ chibihash64 input seed
Synopsis
- chibihash64 :: ByteString -> Word64 -> Word64
Hash Function
chibihash64 :: ByteString -> Word64 -> Word64 Source #
Main hash function that processes input in several stages: 1. Process full 32-byte blocks 2. Process remaining bytes (< 32 bytes) 3. Apply final mixing function