hashlib
hashlib
20081119
Python secure hash and message digest module
MD5, SHA1, SHA224, SHA256, SHA384 and SHA512
(backported from recent Python's for use on 2.3 and 2.4)
DOWNLOADS
hashlib source code: (.tar.gz) or (.zip)
BUILDING
python setup.py build [options]
Valid options: --openssl-prefix=path, --openssl-incdir=path, --openssl-libdir=path
If OpenSSL 0.9.7 or later is found it will be used. Version 0.9.8 is preferred as it provides many more optimized algorithms. OpenSSL is not required.
INSTALLING
python setup.py install
USAGE
Use the following hash object constructors:
md5, sha1, sha224, sha256, sha384, and sha512
Hash objects have update, copy, digest, and hexdigest methods.
>>> x = hashlib.sha224('spam') >>> x.hexdigest() 'e047c44d875407fdb49d53d8b2326fc3e20e27f08434fef1275a3981' >>> y = x.copy() >>> y.update(' and eggs') >>> y.hexdigest() '1c54f569f9b5c7cec6a34465de51df10b0048f3d48f7051ac6eb2e54'
DOCUMENTATION
Real documentation for this module can be found on python.org:
http://docs.python.org/library/hashlib.html
Happy hashing!
Gregory P. Smith .. greg at krypto dot org
LICENSE
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
The following also applies to binary packages of this module if they are linked with OpenSSL:
"This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
CHANGELOG
20081119: * Synced to svn.python.org r66496: * Fix possible integer overflows in _hashopenssl #3886 - benjamin.peterson * Make use of METH_O and METH_NOARGS where possible. - georg.brandl * Use Py_UnpackTuple instead of PyArg_ParseTuple. - georg.brandl * Improved the docstrings. - gregory.p.smith 20060408a: * Initial stand alone release.