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.2.1.tbz
sha256=9cfb7291a7d90ca0e55ece33040ad41e74cadd8c6446e04c33558bc1a1951518
sha512=9605acd77de9aae70ae96554a28594e6ed5beba70a48145c0fc2204b32bb23b843ba98cf034e88391581d5f3495154195c644d64a3aa3f8d3994a9c5518c5cda

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

Module Make.HashSource

Object hashes.

Signature for digest hashes, inspired by Digestif.

type t = hash

The type for digest hashes.

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 hash_size : int

hash_size is the size of hash results, in bytes.

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.

val 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

val t : t Irmin.Type.t

t is the value type for t.

OCaml

Innovation. Community. Security.