memory-0.18.0: memory and related abstraction stuff
LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilityexperimental
Portabilitygood
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.ByteArray.Hash

Description

provide the SipHash algorithm. reference: http://131002.net/siphash/siphash.pdf

Synopsis

SipHash

data SipKey Source #

SigHash Key

Constructors

SipKey !Word64 !Word64 

newtype SipHash Source #

Siphash tag value

Constructors

SipHash Word64 

Instances

Instances details
Show SipHash Source # 
Instance details

Defined in Data.Memory.Hash.SipHash

Eq SipHash Source # 
Instance details

Defined in Data.Memory.Hash.SipHash

Methods

(==) :: SipHash -> SipHash -> Bool #

(/=) :: SipHash -> SipHash -> Bool #

Ord SipHash Source # 
Instance details

Defined in Data.Memory.Hash.SipHash

sipHash :: ByteArrayAccess ba => SipKey -> ba -> SipHash Source #

Compute the SipHash tag of a byte array for a given key.

sipHash is equivalent to 'sipHashWith 2 4'

sipHashWith Source #

Arguments

:: ByteArrayAccess ba 
=> Int

c rounds

-> Int

d rounds

-> SipKey

key

-> ba

data to hash

-> SipHash 

Compute the SipHash tag of a byte array for a given key.

The user can choose the C and D numbers of rounds.

calling sipHash is equivalent to 'sipHashWith 2 4'

FNV1 and FNV1a (32 and 64 bits)

newtype FnvHash32 Source #

FNV1(a) hash (32 bit variants)

Constructors

FnvHash32 Word32 

Instances

Instances details
Show FnvHash32 Source # 
Instance details

Defined in Data.Memory.Hash.FNV

NFData FnvHash32 Source # 
Instance details

Defined in Data.Memory.Hash.FNV

Methods

rnf :: FnvHash32 -> () #

Eq FnvHash32 Source # 
Instance details

Defined in Data.Memory.Hash.FNV

Ord FnvHash32 Source # 
Instance details

Defined in Data.Memory.Hash.FNV

newtype FnvHash64 Source #

FNV1(a) hash (64 bit variants)

Constructors

FnvHash64 Word64 

Instances

Instances details
Show FnvHash64 Source # 
Instance details

Defined in Data.Memory.Hash.FNV

NFData FnvHash64 Source # 
Instance details

Defined in Data.Memory.Hash.FNV

Methods

rnf :: FnvHash64 -> () #

Eq FnvHash64 Source # 
Instance details

Defined in Data.Memory.Hash.FNV

Ord FnvHash64 Source # 
Instance details

Defined in Data.Memory.Hash.FNV

fnv1Hash :: ByteArrayAccess ba => ba -> FnvHash32 Source #

Compute the FNV1 32 bit hash value of a byte array

fnv1aHash :: ByteArrayAccess ba => ba -> FnvHash32 Source #

Compute the FNV1a 32 bit hash value of a byte array

fnv1_64Hash :: ByteArrayAccess ba => ba -> FnvHash64 Source #

Compute the FNV1 64 bit hash value of a byte array

fnv1a_64Hash :: ByteArrayAccess ba => ba -> FnvHash64 Source #

Compute the FNV1a 64 bit hash value of a byte array