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 module provides both V1 and V2 implementations.
Example usage:
import ChibiHash (chibihash64) -- Uses V1 by default import qualified ChibiHash.V2 as V2 main :: IO () main = do let input = BS.pack [1,2,3,4] let seed = 0 print $ chibihash64 input seed -- V1 hash print $ V2.chibihash64 input seed -- V2 hash
Synopsis
- chibihash64 :: ByteString -> Word64 -> Word64
- chibihash64V1 :: ByteString -> Word64 -> Word64
- chibihash64V2 :: ByteString -> Word64 -> Word64
Hash Functions
chibihash64 :: ByteString -> Word64 -> Word64 Source #
Hash a ByteString with the default (V1) implementation
chibihash64V1 :: ByteString -> Word64 -> Word64 Source #
Hash a ByteString with the V1 implementation
chibihash64V2 :: ByteString -> Word64 -> Word64 Source #
Hash a ByteString with the V2 implementation