A 64-bit hash
Moduledata-hash-0.2.0.1Haskell98
Data.Hash
Combinators for building fast hashing functions.
Based on the BuzHash algorithm by Robert Uzgalis (see, e.g. "Hashing concepts and the Java programming language" at http://www.serve.net/buz/hash.adt/java.000.html)
Synopsis
- newtype Hash
- value asWord64
- value hashWord8
- value combine
- value hashWord16
- value hashWord32
- value hashWord64
- value hashInt
- value hashStorable
- value hashFoldable
- class Hashable
- Packagedata-hash-0.2.0.1
- Exports11
- LanguageHaskell98
- LicenceBSD-3-Clause
- SourceHash.hs
The Hash type
Basic combinators
h1 `combine` h2 combines hashes h1 and h2 into a new hash.
It is used to generate hash functions for complex types. For example:
hashPair :: (Hashable a, Hashable b) => (a,b) -> Hash
hashPair (a,b) = hash a `combine` hash b
Derived combinators
Observe that, unlike the other functions in this module,
hashStorable is machine-dependent (the computed hash depends
on endianness, etc.).
The Hashable class
Instances23Hashable, …
Hashable IntegerDefined in data-hash-0.2.0.1 · Data.Hash.InstancesHashable Int16Defined in data-hash-0.2.0.1 · Data.Hash.InstancesHashable Int32Defined in data-hash-0.2.0.1 · Data.Hash.InstancesHashable Int64Defined in data-hash-0.2.0.1 · Data.Hash.InstancesHashable Int8Defined in data-hash-0.2.0.1 · Data.Hash.InstancesHashable BoolDefined in data-hash-0.2.0.1 · Data.Hash.InstancesHashable CharDefined in data-hash-0.2.0.1 · Data.Hash.InstancesHashable DoubleDefined in data-hash-0.2.0.1 · Data.Hash.InstancesHashable FloatDefined in data-hash-0.2.0.1 · Data.Hash.InstancesHashable IntDefined in data-hash-0.2.0.1 · Data.Hash.InstancesHashable WordDefined in data-hash-0.2.0.1 · Data.Hash.InstancesHashable Word16Defined in data-hash-0.2.0.1 · Data.Hash.InstancesHashable Word32Defined in data-hash-0.2.0.1 · Data.Hash.InstancesHashable Word64Defined in data-hash-0.2.0.1 · Data.Hash.InstancesHashable Word8Defined in data-hash-0.2.0.1 · Data.Hash.InstancesHashable ()Defined in data-hash-0.2.0.1 · Data.Hash.InstancesHashable a => Hashable (Maybe a)Defined in data-hash-0.2.0.1 · Data.Hash.InstancesHashable a => Hashable [a]Defined in data-hash-0.2.0.1 · Data.Hash.Instances(Integral a, Hashable a) => Hashable (Ratio a)Defined in data-hash-0.2.0.1 · Data.Hash.Instances(Hashable a, Hashable b) => Hashable (Either a b)Defined in data-hash-0.2.0.1 · Data.Hash.Instances(Hashable a, Hashable b) => Hashable (a, b)Defined in data-hash-0.2.0.1 · Data.Hash.Instances(Hashable a, Hashable b, Hashable c) => Hashable (a, b, c)Defined in data-hash-0.2.0.1 · Data.Hash.Instances(Hashable a, Hashable b, Hashable c, Hashable d) => Hashable (a, b, c, d)Defined in data-hash-0.2.0.1 · Data.Hash.Instances
Rolling hashes
module Data.Hash.Rolling