package irmin
- Overview
- No Docs
You can search for identifiers within the package.
in-package search v0.2.0
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=8e073abe1b5ffb5b6d58c32606c9d7dabc32c53501756be80a92ed4777ad51a0
sha512=70769a8d36520626fecd6f68e5f3abe6a0d67a65af915312206cc3f4da230df48512faee178aa6e899d3fb640b9340f6c92486185be5432a1a1a161c70386c99
doc/irmin.mem/Irmin_mem/Content_addressable/argument-1-Hash/index.html
Parameter Content_addressable.Hash
Signature for digest hashes, inspired by Digestif.
val hash : ((string -> unit) -> unit) -> t
Compute a deterministic store key from a sequence of strings.
val short_hash : t -> int
short_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 -> string
to_raw_string t
is the raw sequence of bytes in t
(of length hash_size
).
val unsafe_of_raw_string : string -> t
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_hash
but may be more efficient due to not needing to allocate an intermediate string
.
Value Types
val t : t Irmin.Type.t
t
is the value type for t
.