Up

module SHA

: sig
#
module type S = sig

Signature for SHA1 values

include Object.S
#
val of_string : string -> t

Build a hash from a string.

#
val of_cstruct : Cstruct.t -> t

Build a hash from a cstruct.

#
val to_raw : t -> string

Raw SHA1 value.

#
val of_raw : string -> t

Abstract a raw SHA1 value.

#
val to_hex : t -> string

Display the hex encoding of the SHA1 hash.

#
val of_hex : string -> t

Convert an hex-encoded string into a sha1 value.

#
val input_hex : Mstruct.t -> t

Read an hex-encode SHA1 value.

#
val add_hex : Buffer.t -> t -> unit

Add the hex-encoding of the SHA1 value to the buffer.

#
val zero : t

A SHA1 full of zero. Useful for padding.

#
module Set : Misc.Set with type elt = t
#
module Map : Misc.Map with type key = t
end

Unique object identifiers using SHA1.

include S
#
module Commit : S

Commit nodes.

#
val of_commit : Commit.t -> t

A commit node is also a node.

#
val to_commit : t -> Commit.t

A node might be a commit.

#
module Tree : S

Treee nodes.

#
val of_tree : Tree.t -> t

A tree node is also a node.

#
val to_tree : t -> Tree.t

A node might be a node.

#
module Blob : S

Blob nodes.

#
val of_blob : Blob.t -> t

A blob node is also a node.

#
val to_blob : t -> Blob.t

A node might be a blob node.

end