Description
a simple and fast 64-bit hash function.
Description
Haskell port of ChibiHash, a simple and fast 64-bit hash function.
Features:
Fast 64-bit hashing
Suitable for hash tables and hash-based data structures
Supports both V1 and V2 implementations
For more information, see the article "ChibiHash: A small, fast 64-bit hash function" at https://nrk.neocities.org/articles/chibihash
README.md
ChibiHash-hs
Haskell port of N-R-K/ChibiHash. See the article ChibiHash: A small, fast 64-bit hash function for more information.
All credit for the algorithm goes to N-R-K.
Usage
module Main (main) where
import ChibiHash (chibihash64)
import qualified Data.ByteString.Char8 as C8
main :: IO ()
main = do
let text = "Hello, ChibiHash!"
putStrLn $ "Input text: " ++ show text
putStrLn $ "Hash (seed 0): " ++ show (chibihash64 (C8.pack text) 0)
You may also run the example program with cabal run
.
Tests
Run tests with cabal test
. Both v1 and v2 are tested.
License
MIT.