Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(13414)

Side by Side Diff: Doc/library/hashlib.rst

Issue 16113: Add SHA-3 (Keccak) support
Patch Set: Created 5 years, 9 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Doc/whatsnew/3.4.rst » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 :mod:`hashlib` --- Secure hashes and message digests 1 :mod:`hashlib` --- Secure hashes and message digests
2 ==================================================== 2 ====================================================
3 3
4 .. module:: hashlib 4 .. module:: hashlib
5 :synopsis: Secure hash and message digest algorithms. 5 :synopsis: Secure hash and message digest algorithms.
6 .. moduleauthor:: Gregory P. Smith <greg@krypto.org> 6 .. moduleauthor:: Gregory P. Smith <greg@krypto.org>
7 .. sectionauthor:: Gregory P. Smith <greg@krypto.org> 7 .. sectionauthor:: Gregory P. Smith <greg@krypto.org>
8 8
9 9
10 .. index:: 10 .. index::
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 .. note:: 54 .. note::
55 55
56 Feeding string objects into :meth:`update` is not supported, as hashes work 56 Feeding string objects into :meth:`update` is not supported, as hashes work
57 on bytes, not on characters. 57 on bytes, not on characters.
58 58
59 .. index:: single: OpenSSL; (use in module hashlib) 59 .. index:: single: OpenSSL; (use in module hashlib)
60 60
61 Constructors for hash algorithms that are always present in this module are 61 Constructors for hash algorithms that are always present in this module are
62 :func:`md5`, :func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`, 62 :func:`md5`, :func:`sha1`, :func:`sha224`, :func:`sha256`, :func:`sha384`,
63 :func:`sha512`, :func:`sha3_224`, :func:`sha3_256`, :func:`sha3_384`, and 63 and :func:`sha512`. Additional algorithms may also be available depending upon
64 :func:`sha3_512`. Additional algorithms may also be available depending upon
65 the OpenSSL library that Python uses on your platform. 64 the OpenSSL library that Python uses on your platform.
66
67 .. versionchanged:: 3.4
68 Added sha3 family of hash algorithms.
69 65
70 For example, to obtain the digest of the byte string ``b'Nobody inspects the 66 For example, to obtain the digest of the byte string ``b'Nobody inspects the
71 spammish repetition'``:: 67 spammish repetition'``::
72 68
73 >>> import hashlib 69 >>> import hashlib
74 >>> m = hashlib.md5() 70 >>> m = hashlib.md5()
75 >>> m.update(b"Nobody inspects") 71 >>> m.update(b"Nobody inspects")
76 >>> m.update(b" the spammish repetition") 72 >>> m.update(b" the spammish repetition")
77 >>> m.digest() 73 >>> m.digest()
78 b'\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d\xf0\xff\xe9' 74 b'\xbbd\x9c\x83\xdd\x1e\xa5\xc9\xd9\xde\xc9\xa1\x8d\xf0\xff\xe9'
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 225
230 http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf 226 http://csrc.nist.gov/publications/fips/fips180-2/fips180-2.pdf
231 The FIPS 180-2 publication on Secure Hash Algorithms. 227 The FIPS 180-2 publication on Secure Hash Algorithms.
232 228
233 http://en.wikipedia.org/wiki/Cryptographic_hash_function#Cryptographic_hash_a lgorithms 229 http://en.wikipedia.org/wiki/Cryptographic_hash_function#Cryptographic_hash_a lgorithms
234 Wikipedia article with information on which algorithms have known issues a nd 230 Wikipedia article with information on which algorithms have known issues a nd
235 what that means regarding their use. 231 what that means regarding their use.
236 232
237 http://www.ietf.org/rfc/rfc2898.txt 233 http://www.ietf.org/rfc/rfc2898.txt
238 PKCS #5: Password-Based Cryptography Specification Version 2.0 234 PKCS #5: Password-Based Cryptography Specification Version 2.0
OLDNEW
« no previous file with comments | « no previous file | Doc/whatsnew/3.4.rst » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+