Module Base__.Hash
module type Full = Base__.Hash_intf.Fullmodule type S = Base__.Hash_intf.Smodule F : functor (Hash : S) -> Full with type hash_value = Hash.hash_value and type state = Hash.state and type seed = Hash.seedinclude Full with type Full.state = Base_internalhash_types.state and type Full.seed = Base_internalhash_types.seed and type Full.hash_value = Base_internalhash_types.hash_value
type state= Base_internalhash_types.state
val fold_int : state -> int -> statefold_<T> state vincorporates a valuevof type <T> into the hash-state, returning a modified hash-state. Implementations of thefold_<T>functions may mutate thestateargument in place, and return a reference to it. Implementations of the fold_<T> functions should not allocate.
val fold_int64 : state -> int64 -> stateval fold_float : state -> float -> stateval fold_string : state -> string -> state
type seed= Base_internalhash_types.seed
val alloc : unit -> statealloc ()returns a fresh uninitialized hash-state. May allocate.
val reset : ?seed:seed -> state -> statereset ?seed stateinitializes/resets a hash-state with the givenseed, or else a default-seed. Argumentstatemay be mutated. Should not allocate.
type hash_value= Base_internalhash_types.hash_value
val get_hash_value : state -> hash_valueget_hash_valueextracts a hash-value from the hash-state.
module For_tests : sig ... endval create : ?seed:seed -> unit -> statecreate ?seed ()is a convenience. Equivalent toreset ?seed (alloc ()).
val of_fold : (state -> 'a -> state) -> 'a -> hash_valueof_fold foldconstructs a standard hash function from an existing fold function.
module Builtin : sig ... endval run : ?seed:seed -> 'a folder -> 'a -> hash_valuerun ?seed folder xrunsfolderonxin a newly allocated hash-state, initialized using optionalseedor a default-seed.The following identity exists:
run [%hash_fold: T]==[%hash: T]runcan be used if we wish to run a hash-folder with a non-default seed.