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

defn

(Fn [(Ref HydroHashState a)] (Maybe (Array Byte)))

                    (final s)
                

finalizes a multi-part hash using the state s. Returns the final hash.

gen

defn

(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

defn

(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.

keygen

defn

(Fn [] (Array Byte))

                    (keygen)
                

generates a key for use in hashing procedures.

state

external

(Fn [] HydroHashState)

generates a hash state.

update

defn

(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.