1- \section {Built-in Module \sectcode {md5} }
1+ \section {Built-in Module \module {md5} }
22\label {module-md5 }
33\bimodindex {md5}
44
55This module implements the interface to RSA's MD5 message digest
6+ \index {message digest, MD5}
67algorithm (see also Internet \rfc {1321}). Its use is quite
7- straightforward:\ use the \code {md5. new()} to create an md5 object.
8+ straightforward:\ use the \function { new()} to create an md5 object.
89You can now feed this object with arbitrary strings using the
9- \code {update()} method, and at any point you can ask it for the
10+ \method {update()} method, and at any point you can ask it for the
1011\dfn {digest} (a strong kind of 128-bit checksum,
1112a.k.a. `` fingerprint'' ) of the contatenation of the strings fed to it
12- so far using the \code {digest()} method.
13+ so far using the \method {digest()} method.
14+ \index {checksum!MD5}
1315
14- For example, to obtain the digest of the string { \tt " Nobody inspects
15- the spammish repetition" }:
16+ For example, to obtain the digest of the string \code {' Nobody inspects
17+ the spammish repetition' }:
1618
1719\begin {verbatim }
1820>>> import md5
@@ -22,15 +24,13 @@ \section{Built-in Module \sectcode{md5}}
2224>>> m.digest()
2325'\273d\234\203\335\036\245\311\331\336\311\241\215\360\377\351'
2426\end {verbatim }
25- %
27+
2628More condensed:
2729
2830\begin {verbatim }
2931>>> md5.new("Nobody inspects the spammish repetition").digest()
3032'\273d\234\203\335\036\245\311\331\336\311\241\215\360\377\351'
3133\end {verbatim }
32- %
33- \setindexsubitem {(in module md5)}
3434
3535\begin {funcdesc }{new}{\optional {arg}}
3636Return a new md5 object. If \var {arg} is present, the method call
@@ -39,27 +39,26 @@ \section{Built-in Module \sectcode{md5}}
3939
4040\begin {funcdesc }{md5}{\optional {arg}}
4141For backward compatibility reasons, this is an alternative name for the
42- \code {new()} function.
42+ \function {new()} function.
4343\end {funcdesc }
4444
4545An md5 object has the following methods:
4646
47- \setindexsubitem {(md5 method)}
48- \begin {funcdesc }{update}{arg}
47+ \begin {methoddesc }[md5]{update}{arg}
4948Update the md5 object with the string \var {arg}. Repeated calls are
5049equivalent to a single call with the concatenation of all the
5150arguments, i.e.\ \code {m.update(a); m.update(b)} is equivalent to
5251\code {m.update(a+b)}.
53- \end {funcdesc }
52+ \end {methoddesc }
5453
55- \begin {funcdesc } {digest}{}
56- Return the digest of the strings passed to the \code {update()}
54+ \begin {methoddesc }[md5] {digest}{}
55+ Return the digest of the strings passed to the \method {update()}
5756method so far. This is an 16-byte string which may contain
5857non-\ASCII {} characters, including null bytes.
59- \end {funcdesc }
58+ \end {methoddesc }
6059
61- \begin {funcdesc } {copy}{}
60+ \begin {methoddesc }[md5] {copy}{}
6261Return a copy (`` clone'' ) of the md5 object. This can be used to
6362efficiently compute the digests of strings that share a common initial
6463substring.
65- \end {funcdesc }
64+ \end {methoddesc }
0 commit comments