murmur-hash- MurmurHash2 implementation for Haskell.

Safe HaskellSafe-Inferred



Type class and primitives for constructing 64 bit hashes using the MurmurHash2 algorithm. See for details on MurmurHash2.



data Hash64 Source

A 64 bit hash.

asWord64 :: Hash64 -> Word64Source

Extract 64 bit word from hash.

hash64AddWord64 :: Word64 -> Hash64 -> Hash64Source

Add a 64 bit word to the hash.

hash64 :: Hashable64 a => a -> Hash64Source

Create a hash using the default seed.

hash64WithSeed :: Hashable64 a => Word64 -> a -> Hash64Source

Create a hash using a custom seed. h The seed should be non-zero, but other than that can be an arbitrary number. Different seeds will give different hashes, and thus (most likely) different hash collisions.

combine :: (Hash64 -> Hash64) -> (Hash64 -> Hash64) -> Hash64 -> Hash64Source

Combine two hash generators. E.g.,

   hashFoo (Foo a) = hash64AddInt 1 combine hash64Add a