package tezos-context
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=7062cd57addd452852598a2214ade393130efa087b99068d53713bdf912b3680
sha512=08e4091144a03ce3c107fb91a66501bd8b65ca3278917c455a2eaac6df3e108ade63f6ab8340a4bb152d60f404326e464d0ec95d26cafe8e82f870465d24a5fc
doc/tezos-context.helpers/Tezos_context_helpers/Context/Make_proof/argument-1-DB/Hash/index.html
Module DB.Hash
Object hashes.
Signature for digest hashes, inspired by Digestif.
type t = hashThe type for digest hashes.
val hash : ((string -> unit) -> unit) -> tCompute a deterministic store key from a sequence of strings.
val short_hash : t -> intshort_hash h is a small hash of h, to be used for instance as the `hash` function of an OCaml Hashtbl.
val to_raw_string : t -> stringto_raw_string t is the raw sequence of bytes in t (of length hash_size).
val unsafe_of_raw_string : string -> tunsafe_of_raw_string b is the hash consisting of the raw sequence of bytes b.
Warning: this function cannot guarantee that the supplied byte string is a valid output of the hash process, so should only be used on strings that are known to have been built with to_raw_string.
short_hash_substring t off computes the short-hash of the raw hash data contained in t at offset off. It has behaviour equivalent to:
Bigstringaf.substring t ~off ~len:hash_size
|> unsafe_of_raw_string
|> short_hashbut may be more efficient due to not needing to allocate an intermediate string.
Value Types
val t : t Irmin.Type.tt is the value type for t.