summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libmd5.tex
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1994-01-02 01:22:07 (GMT)
committerGuido van Rossum <guido@python.org>1994-01-02 01:22:07 (GMT)
commit5fdeeeae2a12b9956cc84d62eae82f72cabc8664 (patch)
treeac0053479e10099850c8e0d06e31cb3afbf632bb /Doc/lib/libmd5.tex
parent0b0719866e8a32d0a787e73bca9e79df1d1a74f8 (diff)
downloadcpython-5fdeeeae2a12b9956cc84d62eae82f72cabc8664.zip
cpython-5fdeeeae2a12b9956cc84d62eae82f72cabc8664.tar.gz
cpython-5fdeeeae2a12b9956cc84d62eae82f72cabc8664.tar.bz2
Restructured library documentation
Diffstat (limited to 'Doc/lib/libmd5.tex')
-rw-r--r--Doc/lib/libmd5.tex53
1 files changed, 53 insertions, 0 deletions
diff --git a/Doc/lib/libmd5.tex b/Doc/lib/libmd5.tex
new file mode 100644
index 0000000..29e4b31
--- /dev/null
+++ b/Doc/lib/libmd5.tex
@@ -0,0 +1,53 @@
+\section{Built-in module \sectcode{md5}}
+\bimodindex{md5}
+
+This module implements the interface to RSA's MD5 message digest
+algorithm (see also the file \file{md5.doc}). It's use is very
+straightforward: use the function \code{md5} to create an
+\dfn{md5}-object. You can now ``feed'' this object with arbitrary
+strings.
+
+At any time you can ask the ``final'' digest of the object. Internally,
+a temorary copy of the object is made and the digest is computed and
+returned. Because of the copy, the digest operation is not desctructive
+for the object. Before a more exact description of the use, a small
+example: to obtain the digest of the string \code{'abc'}, use \ldots
+
+\bcode\begin{verbatim}
+>>> from md5 import md5
+>>> m = md5()
+>>> m.update('abc')
+>>> m.digest()
+'\220\001P\230<\322O\260\326\226?}(\341\177r'
+\end{verbatim}\ecode
+
+More condensed:
+
+\bcode\begin{verbatim}
+>>> md5('abc').digest()
+'\220\001P\230<\322O\260\326\226?}(\341\177r'
+\end{verbatim}\ecode
+
+\renewcommand{\indexsubitem}{(in module md5)}
+\begin{funcdesc}{md5}{arg}
+ Create a new md5-object. \var{arg} is optional: if present, an initial
+ \code{update} method is called with \var{arg} as argument.
+\end{funcdesc}
+
+An md5-object has the following methods:
+
+\renewcommand{\indexsubitem}{(md5 method)}
+\begin{funcdesc}{update}{arg}
+ Update this md5-object with the string \var{arg}.
+\end{funcdesc}
+
+\begin{funcdesc}{digest}{}
+ Return the \dfn{digest} of this md5-object. Internally, a copy is made
+ and the \C-function \code{MD5Final} is called. Finally the digest is
+ returned.
+\end{funcdesc}
+
+\begin{funcdesc}{copy}{}
+ Return a separate copy of this md5-object. An \code{update} to this
+ copy won't affect the original object.
+\end{funcdesc}