.TH "Digest" 3o 2012-06-26 OCamldoc "OCaml library" .SH NAME Digest \- MD5 message digest. .SH Module Module Digest .SH Documentation .sp Module .BI "Digest" : .B sig end .sp MD5 message digest\&. .sp This module provides functions to compute 128\-bit ``digests\&'\&' of arbitrary\-length strings or files\&. The digests are of cryptographic quality: it is very hard, given a digest, to forge a string having that digest\&. The algorithm used is MD5\&. .sp .sp .sp .sp .I type t = .B string .sp The type of digests: 16\-character strings\&. .sp .sp .I val string : .B string -> t .sp Return the digest of the given string\&. .sp .sp .I val substring : .B string -> int -> int -> t .sp .B Digest\&.substring s ofs len returns the digest of the substring of .B s starting at character number .B ofs and containing .B len characters\&. .sp .sp .I val channel : .B Pervasives.in_channel -> int -> t .sp If .B len is nonnegative, .B Digest\&.channel ic len reads .B len characters from channel .B ic and returns their digest, or raises .B End_of_file if end\-of\-file is reached before .B len characters are read\&. If .B len is negative, .B Digest\&.channel ic len reads all characters from .B ic until end\-of\-file is reached and return their digest\&. .sp .sp .I val file : .B string -> t .sp Return the digest of the file whose name is given\&. .sp .sp .I val output : .B Pervasives.out_channel -> t -> unit .sp Write a digest on the given output channel\&. .sp .sp .I val input : .B Pervasives.in_channel -> t .sp Read a digest from the given input channel\&. .sp .sp .I val to_hex : .B t -> string .sp Return the printable hexadecimal representation of the given digest\&. .sp .sp