murmur-hash-0.1.0.9: MurmurHash2 implementation for Haskell.

Copyright | (c) Thomas Schilling 2010
License | BSD-style
Maintainer | nominolo@gmail.com
Stability | experimental
Portability | portable
Safe Haskell | Safe
Language | Haskell98

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

- data Hash64
- asWord64 :: Hash64 -> Word64
- class Hashable64 a where
  - hash64Add :: a -> Hash64 -> Hash64
- 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

data Hash64 Source #

A 64 bit hash.

#### Instances

Instances details

Bounded Hash64 Source # |
Instance details Defined in Data.Digest.Murmur64 Methods minBound :: Hash64 maxBound :: Hash64
Eq Hash64 Source # |
Instance details Defined in Data.Digest.Murmur64 Methods (==) :: Hash64 -> Hash64 -> Bool (/=) :: Hash64 -> Hash64 -> Bool
Ord Hash64 Source # |
Instance details Defined in Data.Digest.Murmur64 Methods compare :: Hash64 -> Hash64 -> Ordering (<) :: Hash64 -> Hash64 -> Bool (<=) :: Hash64 -> Hash64 -> Bool (>) :: Hash64 -> Hash64 -> Bool (>=) :: Hash64 -> Hash64 -> Bool max :: Hash64 -> Hash64 -> Hash64 min :: Hash64 -> Hash64 -> Hash64
Show Hash64 Source # |
Instance details Defined in Data.Digest.Murmur64 Methods showsPrec :: Int -> Hash64 -> ShowS show :: Hash64 -> String showList :: [Hash64] -> ShowS

asWord64 :: Hash64 -> Word64 Source #

Extract 64 bit word from hash.

class Hashable64 a where Source #

Methods

hash64Add :: a -> Hash64 -> Hash64 Source #

#### Instances

Instances details

Hashable64 Bool Source # |
Instance details Defined in Data.Digest.Murmur64 Methods hash64Add :: Bool -> Hash64 -> Hash64 Source #
Hashable64 Char Source # |
Instance details Defined in Data.Digest.Murmur64 Methods hash64Add :: Char -> Hash64 -> Hash64 Source #
Hashable64 Int Source # |
Instance details Defined in Data.Digest.Murmur64 Methods hash64Add :: Int -> Hash64 -> Hash64 Source #
Hashable64 Integer Source # |
Instance details Defined in Data.Digest.Murmur64 Methods hash64Add :: Integer -> Hash64 -> Hash64 Source #
Hashable64 Word64 Source # |
Instance details Defined in Data.Digest.Murmur64 Methods hash64Add :: Word64 -> Hash64 -> Hash64 Source #
Hashable64 () Source # |
Instance details Defined in Data.Digest.Murmur64 Methods hash64Add :: () -> Hash64 -> Hash64 Source #
Hashable64 ByteString Source # |
Instance details Defined in Data.Digest.Murmur64 Methods hash64Add :: ByteString -> Hash64 -> Hash64 Source #
Hashable64 ByteString Source # |
Instance details Defined in Data.Digest.Murmur64 Methods hash64Add :: ByteString -> Hash64 -> Hash64 Source #
Hashable64 a => Hashable64 [a] Source # |
Instance details Defined in Data.Digest.Murmur64 Methods hash64Add :: [a] -> Hash64 -> Hash64 Source #
Hashable64 a => Hashable64 (Maybe a) Source # |
Instance details Defined in Data.Digest.Murmur64 Methods hash64Add :: Maybe a -> Hash64 -> Hash64 Source #
(Hashable64 a, Hashable64 b) => Hashable64 (Either a b) Source # |
Instance details Defined in Data.Digest.Murmur64 Methods hash64Add :: Either a b -> Hash64 -> Hash64 Source #
(Hashable64 a, Hashable64 b) => Hashable64 (a, b) Source # |
Instance details Defined in Data.Digest.Murmur64 Methods hash64Add :: (a, b) -> Hash64 -> Hash64 Source #
(Hashable64 a, Hashable64 b, Hashable64 c) => Hashable64 (a, b, c) Source # |
Instance details Defined in Data.Digest.Murmur64 Methods hash64Add :: (a, b, c) -> Hash64 -> Hash64 Source #
(Hashable64 a, Hashable64 b, Hashable64 c, Hashable64 d) => Hashable64 (a, b, c, d) Source # |
Instance details Defined in Data.Digest.Murmur64 Methods hash64Add :: (a, b, c, d) -> Hash64 -> Hash64 Source #

hash64AddWord64 :: Word64 -> Hash64 -> Hash64 Source #

Add a 64 bit word to the hash.

hash64AddInt :: Int -> Hash64 -> Hash64 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. 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 -> Hash64 Source #

Combine two hash generators. E.g.,

      hashFoo (Foo a) = hash64AddInt 1 combine hash64Add a