package irmin
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=09996fbcc2c43e117a9bd8e9028c635e81cccb264d5e02d425ab8b06bbacdbdb
sha512=0391a6bf7b94a1edd50a3a8df9e58961739fa78d7d689d61f56bc87144483bad2ee539df595c33d9d52c29b3458da5dddf3a73b5eb85e49c4667c26d2cd46be1
doc/irmin.mem/Irmin_mem/KV/Make/Schema/Hash/index.html
Module Schema.HashSource
Signature for digest hashes, inspired by Digestif.
Compute a deterministic store key from a sequence of strings.
short_hash h is a small hash of h, to be used for instance as the `hash` function of an OCaml Hashtbl.
hash_size is the size of hash results, in bytes.
to_raw_string t is the raw sequence of bytes in t (of length hash_size).
unsafe_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
t is the value type for t.