License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | experimental |
Portability | good |
Safe Haskell | None |
Language | Haskell2010 |
provide the SipHash algorithm. reference: http://131002.net/siphash/siphash.pdf
Synopsis
- data SipKey = SipKey !Word64 !Word64
- newtype SipHash = SipHash Word64
- sipHash :: ByteArrayAccess ba => SipKey -> ba -> SipHash
- sipHashWith :: ByteArrayAccess ba => Int -> Int -> SipKey -> ba -> SipHash
- newtype FnvHash32 = FnvHash32 Word32
- newtype FnvHash64 = FnvHash64 Word64
- fnv1Hash :: ByteArrayAccess ba => ba -> FnvHash32
- fnv1aHash :: ByteArrayAccess ba => ba -> FnvHash32
- fnv1_64Hash :: ByteArrayAccess ba => ba -> FnvHash64
- fnv1a_64Hash :: ByteArrayAccess ba => ba -> FnvHash64
SipHash
sipHash :: ByteArrayAccess ba => SipKey -> ba -> SipHash #
Compute the SipHash tag of a byte array for a given key.
sipHash
is equivalent to 'sipHashWith 2 4'
:: 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)
FNV1(a) hash (32 bit variants)
FNV1(a) hash (64 bit variants)
fnv1Hash :: ByteArrayAccess ba => ba -> FnvHash32 #
Compute the FNV1 32 bit hash value of a byte array
fnv1aHash :: ByteArrayAccess ba => ba -> FnvHash32 #
Compute the FNV1a 32 bit hash value of a byte array
fnv1_64Hash :: ByteArrayAccess ba => ba -> FnvHash64 #
Compute the FNV1 64 bit hash value of a byte array
fnv1a_64Hash :: ByteArrayAccess ba => ba -> FnvHash64 #
Compute the FNV1a 64 bit hash value of a byte array