HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulefoundation-0.0.30Haskell2010

Foundation.Hashing

  • 6 types
  • 2 classes
  • Packagefoundation-0.0.30
  • Exports8
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceHashable.hs
classclass Hashable a where
#

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

Methods

Instances27Hashable, …
classclass Hasher st where
#

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

Instances6Hasher
  • Hasher FNV1_32Defined in foundation-0.0.30 · Foundation.Hashing.FNV
  • Hasher FNV1_64Defined in foundation-0.0.30 · Foundation.Hashing.FNV
  • Hasher FNV1a_32Defined in foundation-0.0.30 · Foundation.Hashing.FNV
  • Hasher FNV1a_64Defined in foundation-0.0.30 · Foundation.Hashing.FNV
  • Hasher Sip1_3Defined in foundation-0.0.30 · Foundation.Hashing.SipHash
  • Hasher Sip2_4Defined in foundation-0.0.30 · Foundation.Hashing.SipHash

Specific methods

6 declarations
newtypenewtype FNV1_32
#

FNV1 32 bit state

Instances3Hasher, HashInitParam, HashResult
  • Hasher FNV1_32Defined in foundation-0.0.30 · Foundation.Hashing.FNV
  • type HashInitParam FNV1_32 = WordDefined in foundation-0.0.30 · Foundation.Hashing.FNV
  • type HashResult FNV1_32 = FNV1Hash32Defined in foundation-0.0.30 · Foundation.Hashing.FNV
newtypenewtype FNV1_64
#

FNV1 64 bit state

Instances3Hasher, HashInitParam, HashResult
  • Hasher FNV1_64Defined in foundation-0.0.30 · Foundation.Hashing.FNV
  • type HashInitParam FNV1_64 = Word64Defined in foundation-0.0.30 · Foundation.Hashing.FNV
  • type HashResult FNV1_64 = FNV1Hash64Defined in foundation-0.0.30 · Foundation.Hashing.FNV
newtypenewtype FNV1a_32
#

FNV1a 32 bit state

Instances3Hasher, HashInitParam, HashResult
  • Hasher FNV1a_32Defined in foundation-0.0.30 · Foundation.Hashing.FNV
  • type HashInitParam FNV1a_32 = WordDefined in foundation-0.0.30 · Foundation.Hashing.FNV
  • type HashResult FNV1a_32 = FNV1Hash32Defined in foundation-0.0.30 · Foundation.Hashing.FNV
newtypenewtype FNV1a_64
#

FNV1a 64 bit state

Instances3Hasher, HashInitParam, HashResult
  • Hasher FNV1a_64Defined in foundation-0.0.30 · Foundation.Hashing.FNV
  • type HashInitParam FNV1a_64 = Word64Defined in foundation-0.0.30 · Foundation.Hashing.FNV
  • type HashResult FNV1a_64 = FNV1Hash64Defined in foundation-0.0.30 · Foundation.Hashing.FNV
newtypenewtype Sip1_3
#

Sip State 1-3 (1 compression rounds, 3 digest rounds)

Instances3Hasher, HashInitParam, HashResult
  • Hasher Sip1_3Defined in foundation-0.0.30 · Foundation.Hashing.SipHash
  • type HashInitParam Sip1_3 = SipKeyDefined in foundation-0.0.30 · Foundation.Hashing.SipHash
  • type HashResult Sip1_3 = SipHashDefined in foundation-0.0.30 · Foundation.Hashing.SipHash
newtypenewtype Sip2_4
#

Sip State 2-4 (2 compression rounds, 4 digest rounds)

Instances3Hasher, HashInitParam, HashResult
  • Hasher Sip2_4Defined in foundation-0.0.30 · Foundation.Hashing.SipHash
  • type HashInitParam Sip2_4 = SipKeyDefined in foundation-0.0.30 · Foundation.Hashing.SipHash
  • type HashResult Sip2_4 = SipHashDefined in foundation-0.0.30 · Foundation.Hashing.SipHash