struct

SipHash64(CROUNDS, DROUNDS)

Inherits Struct / Value / Object

A streaming version of SipHash with a fixed UInt64 output.

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 SipHash64::Key
SecureRandom.random_bytes(key.to_slice)

hasher = SipHash64(2, 4).new(key)
hasher.update("some ")
hasher.update("input data")
hash = hasher.final

Constructors

new(key : Key)
Source

Instance methods

final(output : Bytes) : Nil
Source
final
Source
update(data : String) : Nil
Source
update(data : Bytes) : Nil
Source

Nested types