295 lines
3.6 KiB
HTML
295 lines
3.6 KiB
HTML
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<HTML><HEAD><TITLE>Man page of Stdlib.Digest</TITLE>
|
|
</HEAD><BODY>
|
|
<H1>Stdlib.Digest</H1>
|
|
Section: OCaml library (3o)<BR>Updated: 2020-01-30<BR><A HREF="#index">Index</A>
|
|
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
|
|
|
|
<A NAME="lbAB"> </A>
|
|
<H2>NAME</H2>
|
|
|
|
Stdlib.Digest - no description
|
|
<A NAME="lbAC"> </A>
|
|
<H2>Module</H2>
|
|
|
|
Module Stdlib.Digest
|
|
<A NAME="lbAD"> </A>
|
|
<H2>Documentation</H2>
|
|
|
|
<P>
|
|
Module
|
|
<B>Digest</B>
|
|
|
|
<BR> :
|
|
<B>(module Stdlib__digest)</B>
|
|
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>type t </I>
|
|
|
|
=
|
|
<B>string</B>
|
|
|
|
<P>
|
|
<P>
|
|
The type of digests: 16-character strings.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val compare </I>
|
|
|
|
:
|
|
<B>t -> t -> int</B>
|
|
|
|
<P>
|
|
The comparison function for 16-character digest, with the same
|
|
specification as
|
|
<B>compare</B>
|
|
|
|
and the implementation
|
|
shared with
|
|
<B>String.compare</B>
|
|
|
|
. Along with the type
|
|
<B>t</B>
|
|
|
|
, this
|
|
function
|
|
<B>compare</B>
|
|
|
|
allows the module
|
|
<B>Digest</B>
|
|
|
|
to be passed as
|
|
argument to the functors
|
|
<B>Set.Make</B>
|
|
|
|
and
|
|
<B>Map.Make</B>
|
|
|
|
.
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.00.0
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val equal </I>
|
|
|
|
:
|
|
<B>t -> t -> bool</B>
|
|
|
|
<P>
|
|
The equal function for 16-character digest.
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.03.0
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val string </I>
|
|
|
|
:
|
|
<B>string -> t</B>
|
|
|
|
<P>
|
|
Return the digest of the given string.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val bytes </I>
|
|
|
|
:
|
|
<B>bytes -> t</B>
|
|
|
|
<P>
|
|
Return the digest of the given byte sequence.
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.02.0
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val substring </I>
|
|
|
|
:
|
|
<B>string -> int -> int -> t</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>Digest.substring s ofs len</B>
|
|
|
|
returns the digest of the substring
|
|
of
|
|
<B>s</B>
|
|
|
|
starting at index
|
|
<B>ofs</B>
|
|
|
|
and containing
|
|
<B>len</B>
|
|
|
|
characters.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val subbytes </I>
|
|
|
|
:
|
|
<B>bytes -> int -> int -> t</B>
|
|
|
|
<P>
|
|
<P>
|
|
<B>Digest.subbytes s ofs len</B>
|
|
|
|
returns the digest of the subsequence
|
|
of
|
|
<B>s</B>
|
|
|
|
starting at index
|
|
<B>ofs</B>
|
|
|
|
and containing
|
|
<B>len</B>
|
|
|
|
bytes.
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.02.0
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val channel </I>
|
|
|
|
:
|
|
<B>in_channel -> int -> t</B>
|
|
|
|
<P>
|
|
If
|
|
<B>len</B>
|
|
|
|
is nonnegative,
|
|
<B>Digest.channel ic len</B>
|
|
|
|
reads
|
|
<B>len</B>
|
|
|
|
characters from channel
|
|
<B>ic</B>
|
|
|
|
and returns their digest, or raises
|
|
<B>End_of_file</B>
|
|
|
|
if end-of-file is reached before
|
|
<B>len</B>
|
|
|
|
characters
|
|
are read. If
|
|
<B>len</B>
|
|
|
|
is negative,
|
|
<B>Digest.channel ic len</B>
|
|
|
|
reads
|
|
all characters from
|
|
<B>ic</B>
|
|
|
|
until end-of-file is reached and return
|
|
their digest.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val file </I>
|
|
|
|
:
|
|
<B>string -> t</B>
|
|
|
|
<P>
|
|
Return the digest of the file whose name is given.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val output </I>
|
|
|
|
:
|
|
<B>out_channel -> t -> unit</B>
|
|
|
|
<P>
|
|
Write a digest on the given output channel.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val input </I>
|
|
|
|
:
|
|
<B>in_channel -> t</B>
|
|
|
|
<P>
|
|
Read a digest from the given input channel.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val to_hex </I>
|
|
|
|
:
|
|
<B>t -> string</B>
|
|
|
|
<P>
|
|
Return the printable hexadecimal representation of the given digest.
|
|
Raise
|
|
<B>Invalid_argument</B>
|
|
|
|
if the argument is not exactly 16 bytes.
|
|
<P>
|
|
<P>
|
|
<P>
|
|
<I>val from_hex </I>
|
|
|
|
:
|
|
<B>string -> t</B>
|
|
|
|
<P>
|
|
Convert a hexadecimal representation back into the corresponding digest.
|
|
Raise
|
|
<B>Invalid_argument</B>
|
|
|
|
if the argument is not exactly 32 hexadecimal
|
|
characters.
|
|
<P>
|
|
<P>
|
|
<B>Since</B>
|
|
|
|
4.00.0
|
|
<P>
|
|
<P>
|
|
<P>
|
|
|
|
<HR>
|
|
<A NAME="index"> </A><H2>Index</H2>
|
|
<DL>
|
|
<DT id="1"><A HREF="#lbAB">NAME</A><DD>
|
|
<DT id="2"><A HREF="#lbAC">Module</A><DD>
|
|
<DT id="3"><A HREF="#lbAD">Documentation</A><DD>
|
|
</DL>
|
|
<HR>
|
|
This document was created by
|
|
<A HREF="/cgi-bin/man/man2html">man2html</A>,
|
|
using the manual pages.<BR>
|
|
Time: 00:05:57 GMT, March 31, 2021
|
|
</BODY>
|
|
</HTML>
|