struct SipHash(CROUNDS, DROUNDS)
- SipHash(CROUNDS, DROUNDS)
- Struct
- Value
- Object
Overview
SipHash is a family of pseudorandom functions optimized for short inputs.
You may choose how many compression-rounds and finalization-rounds to execute.
For example SipHash(2, 4)
has been verified to be cryptographically secure,
whereas SipHash(1, 3)
is faster but not verified, and should only be used
when the result is never disclosed (e.g. for table hashing).
See https://131002.net/siphash/ for more information.
Example:
key = uninitialized SipHash::Key
SecureRandom.random_bytes(key.to_slice)
hash = SipHash(2, 4).siphash("input data", key)
Defined in:
siphash.crConstructors
Class Method Summary
- .siphash(input : Bytes, output : Bytes, key : Key)
- .siphash(input : Int | Float, key : Key) : UInt64
- .siphash(input : String, key : Key) : UInt64
- .siphash(input : Bytes, key : Key) : UInt64