murmur-hash-0.1.0.7: MurmurHash2 implementation for Haskell.

Portabilityportable
Stabilityexperimental
Maintainernominolo@gmail.com
Safe HaskellSafe-Inferred

Data.Digest.Murmur64

Description

Type class and primitives for constructing 64 bit hashes using the MurmurHash2 algorithm. See http://murmurhash.googlepages.com for details on MurmurHash2.

Synopsis

Documentation

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