diff -r 231d98a38eec Doc/library/hashlib.rst --- a/Doc/library/hashlib.rst Mon Jul 30 18:35:17 2012 -0400 +++ b/Doc/library/hashlib.rst Mon Jul 30 19:44:48 2012 -0400 @@ -51,21 +51,24 @@ .. index:: single: OpenSSL; (use in module hashlib) Constructors for hash algorithms that are always present in this module are -:func:`md5`, :func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`, and -:func:`sha512`. Additional algorithms may also be available depending upon the -OpenSSL library that Python uses on your platform. +:func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`, and +:func:`sha512`. The :func:`md5` is typically available, but will be missing if +Python has been compiled in FIPS-compliant mode. If hashlib was compiled with +OpenSSL support then additional algorithms may also be available depending +upon the OpenSSL library that Python uses on your platform. OpenSSL +implementations of the builtin algorithms are used if available. For example, to obtain the digest of the byte string ``b'Nobody inspects the spammish repetition'``:: >>> import hashlib - >>> m = hashlib.md5() + >>> m = hashlib.sha1() >>> m.update(b"Nobody inspects") >>> m.update(b" the spammish repetition") >>> m.digest() - b'\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d\xf0\xff\xe9' + b'S\x1b\x07\xa0\xf5\xb6dw\xa2\x17B\xd2\x82qv&OK\xbf\xe2' >>> m.digest_size - 16 + 20 >>> m.block_size 64