| License | BSD-style |
|---|---|
| Maintainer | Vincent Hanquez <vincent@snarc.org> |
| Stability | experimental |
| Portability | good |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
Data.ByteArray.Hash
Description
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 tag value
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'
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)
FNV1(a) hash (32 bit variants)
Instances
| Show FnvHash32 Source # | |
| NFData FnvHash32 Source # | |
Defined in Data.Memory.Hash.FNV | |
| Eq FnvHash32 Source # | |
| Ord FnvHash32 Source # | |
FNV1(a) hash (64 bit variants)
Instances
| Show FnvHash64 Source # | |
| NFData FnvHash64 Source # | |
Defined in Data.Memory.Hash.FNV | |
| Eq FnvHash64 Source # | |
| Ord FnvHash64 Source # | |
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