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.
length
val hash : Bytes.t -> t
hash b hashes bytes b.
hash b
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.
of_bytes b
Invalid_argument
val to_bytes : t -> Bytes.t
to_bytes h are the bytes of h.
to_bytes h
h
val equal : t -> t -> bool
equal h h' determines in constant time if h and h' are bytewise equal.
equal h h'
h'
val pp : Stdlib.Format.formatter -> t -> unit
pp ppf n is an unspecified formatter for hashes.
pp ppf n