-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Combinators for building fast hashing functions. -- -- Combinators for building fast hashing functions. Includes hashing -- functions for all basic Haskell98 types. @package data-hash @version 0.2.0.0 -- | Efficient implementation of a rolling hash, i.e., the computation of a -- hash through a moving window of a fixed size n over some -- stream. All operations are O(1) (in particular, they do not depend on -- the size of the window). -- -- Some laws that this type satisfies: -- --
currentHash rh == foldl1 combine (lastHashes rh)
length (lastHashes rh) <= windowSize rh
length (lastHashes $ addAndRoll rh a) == windowSize rh -- -- whenever length (lastHashes rh) == windowSize rh
last (lastHashes $ addAndRoll rh x) == hash a
init (lastHashes $ addAndRoll rh a) isSuffixOf -- (lastHashes rh)
-- hashPair :: (Hashable a, Hashable b) => (a,b) -> Hash -- hashPair (a,b) = hash a `combine` hash b --combine :: Hash -> Hash -> Hash hashWord16 :: Word16 -> Hash hashWord32 :: Word32 -> Hash hashWord64 :: Word64 -> Hash hashInt :: Int -> Hash -- | Observe that, unlike the other functions in this module, -- hashStorable is machine-dependent (the computed hash depends -- on endianness, etc.). hashStorable :: Storable a => a -> Hash hashFoldable :: (Foldable t, Hashable a) => t a -> Hash class Hashable a hash :: Hashable a => a -> Hash