SipHash(CROUNDS, DROUNDS)
Inherits Struct / Value / Object
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)
Constructors
new
SourceClass methods
siphash(input : Bytes, output : Bytes, key : Key)
Sourcesiphash(input : Int | Float, key : Key) : UInt64
Sourcesiphash(input : String, key : Key) : UInt64
Sourcesiphash(input : Bytes, key : Key) : UInt64
SourceInstance methods
initialize
Source