package irmin

  1. Overview
  2. Docs
Irmin, a distributed database that follows the same design principles as Git

Install

Dune Dependency

Authors

Maintainers

Sources

irmin-3.7.2.tbz
sha256=6aa5ba4c6a0233747d4bd3ab396f2b3a33bb80f9d8ed4a178c83a035033c0e52
sha512=8a5506a57e8569a11c883ca25b3c60ae7a9a03c2da111668193d7b4296434c43f1a310e78f189e4b38c234da790259d2961c6a0ae481282c18bb97f618fccfb6

doc/irmin.mem/Irmin_mem/KV/Make/Schema/Hash/index.html

Module Schema.HashSource

Signature for digest hashes, inspired by Digestif.

Sourcetype t = hash

The type for digest hashes.

Sourceval hash : ((string -> unit) -> unit) -> t

Compute a deterministic store key from a sequence of strings.

Sourceval 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.

Sourceval hash_size : int

hash_size is the size of hash results, in bytes.

Sourceval to_raw_string : t -> string

to_raw_string t is the raw sequence of bytes in t (of length hash_size).

Sourceval 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.

Sourceval short_hash_substring : Bigstringaf.t -> off:int -> int

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

t is the value type for t.

OCaml

Innovation. Community. Security.