Module B0_std.Hash
Hash values and functions.
The property we want from these functions is speed and collision resistance. Build correctness depends on the latter.
Hash values
type tThe type for hash values. All hash functions use this representation. It is not possible to distinguish them, except for their
lengthwhich might vary, or not.
val length : t -> intlength his the length ofhin bytes.
Predicate and comparisons
Converting
val to_bytes : t -> stringto_bytes his the sequence of bytes ofh.
val of_bytes : string -> tof_bytes sis the sequences of bytes ofsas a hash value.
val to_hex : t -> stringto_hex hisString.Ascii.to_hex(to_bytes h).
val of_hex : string -> (t, int) Stdlib.resultof_hex sisResult.map of_bytes (String.Ascii.of_hexs).
val conv : t Conv.tconvconverts usingConv.string_bytes.
Hash functions
module type T = sig ... endThe type for hash functions.
module Murmur3_128 : TMurmur3_128is the MurmurHash3 128-bit hash.
module Xxh_64 : TXxh_64is 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 maddsmto the list returned byfuns.