Module Crypto.Hash

Hashing

The primitive is SHA-512, NaCl documentation..

type t

The type for hashes.

val length : int

length is the byte length of hashes.

val hash : Bytes.t -> t

hash b hashes bytes b.

val of_bytes : Bytes.t -> t

of_bytes b is a hash from bytes b. Raises Invalid_argument if b's length differs from length.

val to_bytes : t -> Bytes.t

to_bytes h are the bytes of h.

val equal : t -> t -> bool

equal h h' determines in constant time if h and h' are bytewise equal.

val pp : Stdlib.Format.formatter -> t -> unit

pp ppf n is an unspecified formatter for hashes.