rest25/library/md5.rst => rest262/library/md5.rst
f1
2:mod:`md5` --- MD5 message digest algorithm
3===========================================
4
5.. module:: md5
6   :synopsis: RSA's MD5 message digest algorithm.
n7+   :deprecated:
7
8
9.. deprecated:: 2.5
10   Use the :mod:`hashlib` module instead.
11
12.. index::
13   single: message digest, MD5
14   single: checksum; MD5
16This module implements the interface to RSA's MD5 message digest  algorithm (see
17also Internet :rfc:`1321`).  Its use is quite straightforward: use :func:`new`
18to create an md5 object. You can now feed this object with arbitrary strings
19using the :meth:`update` method, and at any point you can ask it for the
20:dfn:`digest` (a strong kind of 128-bit checksum, a.k.a. "fingerprint") of the
21concatenation of the strings fed to it so far using the :meth:`digest` method.
22
23For example, to obtain the digest of the string ``'Nobody inspects the spammish
n24-repetition'``::
n25+repetition'``:
25
26   >>> import md5
27   >>> m = md5.new()
28   >>> m.update("Nobody inspects")
29   >>> m.update(" the spammish repetition")
30   >>> m.digest()
31   '\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d\xf0\xff\xe9'
32
t33-More condensed::
t34+More condensed:
34
35   >>> md5.new("Nobody inspects the spammish repetition").digest()
36   '\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d\xf0\xff\xe9'
37
38The following values are provided as constants in the module and as attributes
39of the md5 objects returned by :func:`new`:
40
41
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op