include S with type t = Tree.t
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.
include IO with type t := t
Add the serialization of the value to an already existing buffer.
level must be between 0 and 9: 1 gives best speed, 9 gives best compression, 0 gives no compression at all (the input data is simply copied a block at a time). The default value (currently equivalent to level 6) requests a default compromise between speed and compression.
val of_hex : string -> t
Convert an hex-encoded string into a hash value. Raise
Ambiguous if the hash is short; in that case use
val of_short_hex : string -> t
val is_short : t -> bool
Check if the hash is short.
val zero : t
A hash full of zero. Useful for padding.