This module handles both usual hashes and short hashes, which are shorter sequences of bits with a valid hexadecimal representation. The only way to create short hashes is to use
of_hex with the
strict argument set to false.
When short hashes are used in normal Git operations, they can raise
This module define various abstraction to distinguish between general, commit, node and blob hashes. It's just an abstraction layer, at runtine they will all be similar.
module type S = sig ... end
Signature for hash values
The usual compare functions on hashes, but can raise
Ambiguous if one is short hash and is prefix to the other.
val to_raw : t -> string
Raw hash value.
val of_raw : string -> t
Abstract a raw hash value.
val to_hex : t -> string
to_hex h is
hs' hex encoding.
val hex_length : t -> int
The number of hex digits in the hash.
module type H = sig ... end
module type IO = sig ... end
type 'a digest = 'a -> t
The type for digest functions.
module type DIGEST = sig ... end
The signature to compute hash digests.