git
  1. Overview
  2. Docs

Treee nodes.

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.

include S
type t

The type for the given Git object.

val equal : t -> t -> bool

Are two objects equal?

val hash : t -> int

Hash an object.

val compare : t -> t -> int

Compare two objects.

val pp : t Fmt.t

pp is the pretty-printer for values of type t.

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.

val lt : t -> t -> bool

(<) relation between hash.

val is_prefix : t -> t -> bool

Check if a hash is a prefix of another hash.

module Set : Set with type elt = t
module Map : Map with type key = t