Copyright | (c) Thomas Schilling 2010 |
---|---|
License | BSD-style |
Maintainer | nominolo@gmail.com |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Type class and primitives for constructing 64 bit hashes using the MurmurHash2 algorithm. See http://murmurhash.googlepages.com for details on MurmurHash2.
Synopsis
- data Hash64
- asWord64 :: Hash64 -> Word64
- class Hashable64 a where
- hash64AddWord64 :: Word64 -> Hash64 -> Hash64
- hash64AddInt :: Int -> Hash64 -> Hash64
- hash64 :: Hashable64 a => a -> Hash64
- hash64WithSeed :: Hashable64 a => Word64 -> a -> Hash64
- combine :: (Hash64 -> Hash64) -> (Hash64 -> Hash64) -> Hash64 -> Hash64
Documentation
A 64 bit hash.
class Hashable64 a where Source #
Instances
Hashable64 Bool Source # | |
Hashable64 Char Source # | |
Hashable64 Int Source # | |
Hashable64 Integer Source # | |
Hashable64 Word64 Source # | |
Hashable64 () Source # | |
Hashable64 ByteString Source # | |
Defined in Data.Digest.Murmur64 | |
Hashable64 ByteString Source # | |
Defined in Data.Digest.Murmur64 | |
Hashable64 a => Hashable64 [a] Source # | |
Hashable64 a => Hashable64 (Maybe a) Source # | |
(Hashable64 a, Hashable64 b) => Hashable64 (Either a b) Source # | |
(Hashable64 a, Hashable64 b) => Hashable64 (a, b) Source # | |
(Hashable64 a, Hashable64 b, Hashable64 c) => Hashable64 (a, b, c) Source # | |
(Hashable64 a, Hashable64 b, Hashable64 c, Hashable64 d) => Hashable64 (a, b, c, d) Source # | |
hash64 :: Hashable64 a => a -> Hash64 Source #
Create a hash using the default seed.
hash64WithSeed :: Hashable64 a => Word64 -> a -> Hash64 Source #
Create a hash using a custom seed.
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.