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.Murmur32

Description

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

Synopsis

- data Hash32
- asWord32 :: Hash32 -> Word32
- class Hashable32 a where
  - hash32Add :: a -> Hash32 -> Hash32
- hash32AddWord32 :: Word32 -> Hash32 -> Hash32
- hash32AddInt :: Int -> Hash32 -> Hash32
- hash32 :: Hashable32 a => a -> Hash32
- hash32WithSeed :: Hashable32 a => Word32 -> a -> Hash32

# Documentation

data Hash32 Source #

A 32 bit hash.

Instances

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

asWord32 :: Hash32 -> Word32 Source #

Extract 32 bit word from hash.

class Hashable32 a where Source #

Instance for

Methods

hash32Add :: a -> Hash32 -> Hash32 Source #

Instances

Hashable32 Bool Source # |
Instance details Defined in Data.Digest.Murmur32 Methods hash32Add :: Bool -> Hash32 -> Hash32 Source #
Hashable32 Char Source # |
Instance details Defined in Data.Digest.Murmur32 Methods hash32Add :: Char -> Hash32 -> Hash32 Source #
Hashable32 Int Source # |
Instance details Defined in Data.Digest.Murmur32 Methods hash32Add :: Int -> Hash32 -> Hash32 Source #
Hashable32 Integer Source # |
Instance details Defined in Data.Digest.Murmur32 Methods hash32Add :: Integer -> Hash32 -> Hash32 Source #
Hashable32 Word32 Source # |
Instance details Defined in Data.Digest.Murmur32 Methods hash32Add :: Word32 -> Hash32 -> Hash32 Source #
Hashable32 () Source # |
Instance details Defined in Data.Digest.Murmur32 Methods hash32Add :: () -> Hash32 -> Hash32 Source #
Hashable32 ByteString Source # |
Instance details Defined in Data.Digest.Murmur32 Methods hash32Add :: ByteString -> Hash32 -> Hash32 Source #
Hashable32 ByteString Source # |
Instance details Defined in Data.Digest.Murmur32 Methods hash32Add :: ByteString -> Hash32 -> Hash32 Source #
Hashable32 a => Hashable32 [a] Source # |
Instance details Defined in Data.Digest.Murmur32 Methods hash32Add :: [a] -> Hash32 -> Hash32 Source #
Hashable32 a => Hashable32 (Maybe a) Source # |
Instance details Defined in Data.Digest.Murmur32 Methods hash32Add :: Maybe a -> Hash32 -> Hash32 Source #
(Hashable32 a, Hashable32 b) => Hashable32 (Either a b) Source # |
Instance details Defined in Data.Digest.Murmur32 Methods hash32Add :: Either a b -> Hash32 -> Hash32 Source #
(Hashable32 a, Hashable32 b) => Hashable32 (a, b) Source # |
Instance details Defined in Data.Digest.Murmur32 Methods hash32Add :: (a, b) -> Hash32 -> Hash32 Source #
(Hashable32 a, Hashable32 b, Hashable32 c) => Hashable32 (a, b, c) Source # |
Instance details Defined in Data.Digest.Murmur32 Methods hash32Add :: (a, b, c) -> Hash32 -> Hash32 Source #
(Hashable32 a, Hashable32 b, Hashable32 c, Hashable32 d) => Hashable32 (a, b, c, d) Source # |
Instance details Defined in Data.Digest.Murmur32 Methods hash32Add :: (a, b, c, d) -> Hash32 -> Hash32 Source #

hash32AddWord32 :: Word32 -> Hash32 -> Hash32 Source #

hash32AddInt :: Int -> Hash32 -> Hash32 Source #

hash32 :: Hashable32 a => a -> Hash32 Source #

Create a hash using the default seed.

hash32WithSeed :: Hashable32 a => Word32 -> a -> Hash32 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.