HydroHash
This module contains functions for hashing, both single and multi-part.
Example:
(let [key (HydroHash.keygen)
msg (Hydro.buf "Arbitrary data to hash")]
(println* &(HydroHash.gen &msg (Hydro.context "Examples") &key))))
final
(Fn [(Ref HydroHashState a)] (Maybe (Array Byte)))
(final s)
finalizes a multi-part hash using the state s
. Returns the
final hash.
gen
(Fn [(Ref (Array Byte) a), (Ptr CChar), (Ref (Array Byte) b)] (Maybe (Array Byte)))
(gen msg ctx key)
hashes a string msg
, using a context ctx
and a key key
.
init
(Fn [(Ref HydroHashState a), (Ptr CChar), (Ref (Array Byte) b)] Int)
(init s ctx k)
initializes a multi-part hash using the state s
, a context ctx
and a key k
.
update
(Fn [(Ref HydroHashState a), (Ref (Array Byte) b)] Int)
(update s buf)
updates a multi-part hash using the state s
, and a buffer
buf
.