Value.Blobtype hash = hashtype nonrec t = Git.Blob.tdigest t associates a hash to any value of t. It is guaranteed that if x = y or compare x y = 0, then digest x = digest y.
val hash : t -> inthash blob associates a non-negative integer to any value of t. It is guaranteed that if x = y or compare x y = 0, then hash x = hash y.
module Set : Stdlib.Set.S with type elt = tmodule Map : Stdlib.Map.S with type key = tval length : t -> int64val of_cstruct : Cstruct.t -> tof_cstruct cs is the blob from the given Cstruct.t cs. This function does not take the ownership on cs.
Note. If the user set the given cs, it updates the blob too. This function does not copy the given Cstruct.t.
let cs = Cstruct.of_string "Hello" in
let blob = Blob.of_cstruct cs in
Blob.digest blob ;;
- : hash = 5ab2f8a4323abafb10abb68657d9d39f1a775057
Cstruct.set_char cs 0 'V' ;;
- : unit = ()
Blob.digest blob ;;
- : hash = 4081c40614b490bea69ea2ed8fdfdb86f04b5579val to_cstruct : t -> Cstruct.tto_cstruct blob is the Cstruct.t from the given blob. This function does not create a fresh Cstruct.t,
val of_string : string -> tof_string str is the blob from the given string str.
Note. Despite of_cstruct, of_string does a copy of the given string.
val to_string : t -> stringto_string blob is the string from the given blob.