Module Caml.Digest
val compare : t -> t -> intThe comparison function for 16-character digest, with the same specification as
Stdlib.compareand the implementation shared withString.compare. Along with the typet, this functioncompareallows the moduleDigestto be passed as argument to the functorsSet.MakeandMap.Make.- since
- 4.00.0
val string : string -> tReturn the digest of the given string.
val bytes : bytes -> tReturn the digest of the given byte sequence.
- since
- 4.02.0
val substring : string -> int -> int -> tDigest.substring s ofs lenreturns the digest of the substring ofsstarting at indexofsand containinglencharacters.
val subbytes : bytes -> int -> int -> tDigest.subbytes s ofs lenreturns the digest of the subsequence ofsstarting at indexofsand containinglenbytes.- since
- 4.02.0
val channel : Stdlib.in_channel -> int -> tIf
lenis nonnegative,Digest.channel ic lenreadslencharacters from channelicand returns their digest, or raisesEnd_of_fileif end-of-file is reached beforelencharacters are read. Iflenis negative,Digest.channel ic lenreads all characters fromicuntil end-of-file is reached and return their digest.
val file : string -> tReturn the digest of the file whose name is given.
val output : Stdlib.out_channel -> t -> unitWrite a digest on the given output channel.
val input : Stdlib.in_channel -> tRead a digest from the given input channel.
val to_hex : t -> stringReturn the printable hexadecimal representation of the given digest. Raise
Invalid_argumentif the argument is not exactly 16 bytes.
val from_hex : string -> tConvert a hexadecimal representation back into the corresponding digest. Raise
Invalid_argumentif the argument is not exactly 32 hexadecimal characters.- since
- 4.00.0