License | BSD-style |
---|---|
Maintainer | Foundation |
Safe Haskell | None |
Language | Haskell2010 |
Documentation
class Hashable a where Source #
Type with the ability to be hashed
Hashable doesn't have any specific rules, and it's made for raw speed. More specifically don't expect different type representing the same data to hash to the same value
hashMix (1 :: Integer) /= hashMix (1 :: Word8)
True
Instances
Incremental Hashing state. Represent an hashing algorithm
the base primitive of this class is
hashMix8
, append
mix a Word8 in the state
The class allow to define faster mixing function that works on bigger Word size and any unboxed array of any PrimType elements
hashNew, hashNewParam, hashMix8, hashEnd
Instances
Specific methods
FNV1 32 bit state
Instances
Hasher FNV1_32 Source # | |
Defined in Foundation.Hashing.FNV hashNewParam :: HashInitParam FNV1_32 -> FNV1_32 hashEnd :: FNV1_32 -> HashResult FNV1_32 hashMix8 :: Word8 -> FNV1_32 -> FNV1_32 hashMix16 :: Word16 -> FNV1_32 -> FNV1_32 hashMix32 :: Word32 -> FNV1_32 -> FNV1_32 hashMix64 :: Word64 -> FNV1_32 -> FNV1_32 hashMixBytes :: PrimType e => UArray e -> FNV1_32 -> FNV1_32 |
FNV1 64 bit state
Instances
Hasher FNV1_64 Source # | |
Defined in Foundation.Hashing.FNV hashNewParam :: HashInitParam FNV1_64 -> FNV1_64 hashEnd :: FNV1_64 -> HashResult FNV1_64 hashMix8 :: Word8 -> FNV1_64 -> FNV1_64 hashMix16 :: Word16 -> FNV1_64 -> FNV1_64 hashMix32 :: Word32 -> FNV1_64 -> FNV1_64 hashMix64 :: Word64 -> FNV1_64 -> FNV1_64 hashMixBytes :: PrimType e => UArray e -> FNV1_64 -> FNV1_64 |
FNV1a 32 bit state
Instances
Hasher FNV1a_32 Source # | |
Defined in Foundation.Hashing.FNV hashNewParam :: HashInitParam FNV1a_32 -> FNV1a_32 hashEnd :: FNV1a_32 -> HashResult FNV1a_32 hashMix8 :: Word8 -> FNV1a_32 -> FNV1a_32 hashMix16 :: Word16 -> FNV1a_32 -> FNV1a_32 hashMix32 :: Word32 -> FNV1a_32 -> FNV1a_32 hashMix64 :: Word64 -> FNV1a_32 -> FNV1a_32 hashMixBytes :: PrimType e => UArray e -> FNV1a_32 -> FNV1a_32 |
FNV1a 64 bit state
Instances
Hasher FNV1a_64 Source # | |
Defined in Foundation.Hashing.FNV hashNewParam :: HashInitParam FNV1a_64 -> FNV1a_64 hashEnd :: FNV1a_64 -> HashResult FNV1a_64 hashMix8 :: Word8 -> FNV1a_64 -> FNV1a_64 hashMix16 :: Word16 -> FNV1a_64 -> FNV1a_64 hashMix32 :: Word32 -> FNV1a_64 -> FNV1a_64 hashMix64 :: Word64 -> FNV1a_64 -> FNV1a_64 hashMixBytes :: PrimType e => UArray e -> FNV1a_64 -> FNV1a_64 |
Sip State 1-3 (1 compression rounds, 3 digest rounds)
Instances
Hasher Sip1_3 Source # | |
Defined in Foundation.Hashing.SipHash hashNewParam :: HashInitParam Sip1_3 -> Sip1_3 hashEnd :: Sip1_3 -> HashResult Sip1_3 hashMix8 :: Word8 -> Sip1_3 -> Sip1_3 hashMix16 :: Word16 -> Sip1_3 -> Sip1_3 hashMix32 :: Word32 -> Sip1_3 -> Sip1_3 hashMix64 :: Word64 -> Sip1_3 -> Sip1_3 hashMixBytes :: PrimType e => UArray e -> Sip1_3 -> Sip1_3 |
Sip State 2-4 (2 compression rounds, 4 digest rounds)
Instances
Hasher Sip2_4 Source # | |
Defined in Foundation.Hashing.SipHash hashNewParam :: HashInitParam Sip2_4 -> Sip2_4 hashEnd :: Sip2_4 -> HashResult Sip2_4 hashMix8 :: Word8 -> Sip2_4 -> Sip2_4 hashMix16 :: Word16 -> Sip2_4 -> Sip2_4 hashMix32 :: Word32 -> Sip2_4 -> Sip2_4 hashMix64 :: Word64 -> Sip2_4 -> Sip2_4 hashMixBytes :: PrimType e => UArray e -> Sip2_4 -> Sip2_4 |