foundation-0.0.3: Alternative prelude with batteries and no dependencies

LicenseBSD-style
MaintainerFoundation
Safe HaskellNone
LanguageHaskell2010

Foundation.Hashing

Contents

Description

 

Synopsis

Documentation

class 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

Minimal complete definition

hashMix

Methods

hashMix :: Hasher st => a -> st -> st #

Instances

Hashable Int8 # 

Methods

hashMix :: Hasher st => Int8 -> st -> st #

Hashable Int16 # 

Methods

hashMix :: Hasher st => Int16 -> st -> st #

Hashable Int32 # 

Methods

hashMix :: Hasher st => Int32 -> st -> st #

Hashable Int64 # 

Methods

hashMix :: Hasher st => Int64 -> st -> st #

Hashable Integer # 

Methods

hashMix :: Hasher st => Integer -> st -> st #

Hashable Word8 # 

Methods

hashMix :: Hasher st => Word8 -> st -> st #

Hashable Word16 # 

Methods

hashMix :: Hasher st => Word16 -> st -> st #

Hashable Word32 # 

Methods

hashMix :: Hasher st => Word32 -> st -> st #

Hashable Word64 # 

Methods

hashMix :: Hasher st => Word64 -> st -> st #

Hashable Natural # 

Methods

hashMix :: Hasher st => Natural -> st -> st #

Hashable String # 

Methods

hashMix :: Hasher st => String -> st -> st #

Hashable a => Hashable [a] # 

Methods

hashMix :: Hasher st => [a] -> st -> st #

PrimType a => Hashable (UArray a) # 

Methods

hashMix :: Hasher st => UArray a -> st -> st #

(Hashable a, Hashable b) => Hashable (a, b) # 

Methods

hashMix :: Hasher st => (a, b) -> st -> st #

(Hashable a, Hashable b) => Hashable (Tuple2 a b) # 

Methods

hashMix :: Hasher st => Tuple2 a b -> st -> st #

(Hashable a, Hashable b, Hashable c) => Hashable (a, b, c) # 

Methods

hashMix :: Hasher st => (a, b, c) -> st -> st #

(Hashable a, Hashable b, Hashable c) => Hashable (Tuple3 a b c) # 

Methods

hashMix :: Hasher st => Tuple3 a b c -> st -> st #

(Hashable a, Hashable b, Hashable c, Hashable d) => Hashable (a, b, c, d) # 

Methods

hashMix :: Hasher st => (a, b, c, d) -> st -> st #

(Hashable a, Hashable b, Hashable c, Hashable d) => Hashable (Tuple4 a b c d) # 

Methods

hashMix :: Hasher st => Tuple4 a b c d -> st -> st #

(Hashable a, Hashable b, Hashable c, Hashable d, Hashable e) => Hashable (a, b, c, d, e) # 

Methods

hashMix :: Hasher st => (a, b, c, d, e) -> st -> st #

(Hashable a, Hashable b, Hashable c, Hashable d, Hashable e, Hashable f) => Hashable (a, b, c, d, e, f) # 

Methods

hashMix :: Hasher st => (a, b, c, d, e, f) -> st -> st #

class Hasher st #

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

Minimal complete definition

hashNew, hashMix8, hashEnd

Instances

Hasher FNV1a_64 # 
Hasher FNV1a_32 # 
Hasher FNV1_64 # 

Associated Types

type HashResult FNV1_64 :: *

Hasher FNV1_32 # 

Associated Types

type HashResult FNV1_32 :: *

Hasher Sip1_3 # 

Associated Types

type HashResult Sip1_3 :: *

Hasher Sip2_4 # 

Associated Types

type HashResult Sip2_4 :: *

Specific methods

data FNV1_32 #

Instances

data FNV1_64 #

Instances

data Sip1_3 #

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

Instances

Hasher Sip1_3 # 

Associated Types

type HashResult Sip1_3 :: *

data Sip2_4 #

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

Instances

Hasher Sip2_4 # 

Associated Types

type HashResult Sip2_4 :: *