Hash values
The type for hash values. All hash functions use this representation. It is not possible to distinguish them, except for their length which might vary, or not.
val length : t -> intlength h is the length of h in bytes.
Predicate and comparisons
Converting
val to_bytes : t -> stringto_bytes h is the sequence of bytes of h.
val of_bytes : string -> tof_bytes s is the sequences of bytes of s as a hash value.
val to_hex : t -> stringto_hex h is String.Ascii.to_hex (to_bytes h).
val of_hex : string -> (t, int) Stdlib.resultof_hex s is Result.map of_bytes (String.Ascii.of_hex s).
Hash functions
module type T = sig ... endThe type for hash functions.
module Murmur3_128 : TMurmur3_128 is the MurmurHash3 128-bit hash.
Xxh_64 is the xxHash 64-bit hash.
val funs : unit -> (module T) listfuns () is the list of available hash functions.
val add_fun : (module T) -> unitadd_fun m adds m to the list returned by funs.
val get_fun : string -> ((module T), string) Stdlib.resultget_fun id is the hash function with identifier id or an error message.