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

Delta Between Two Patch Sets: Lib/hashlib.py

Issue 26798: add BLAKE2 to hashlib
Left Patch Set: Created 3 years, 2 months ago
Right Patch Set: Created 2 years, 11 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « Doc/library/hashlib.rst ('k') | Lib/test/test_hashlib.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 #. Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org) 1 #. Copyright (C) 2005-2010 Gregory P. Smith (greg@krypto.org)
2 # Licensed to PSF under a Contributor Agreement. 2 # Licensed to PSF under a Contributor Agreement.
3 # 3 #
4 4
5 __doc__ = """hashlib module - A common interface to many hash functions. 5 __doc__ = """hashlib module - A common interface to many hash functions.
6 6
7 new(name, data=b'', **kwargs) - returns a new hash object implementing the 7 new(name, data=b'', **kwargs) - returns a new hash object implementing the
8 given hash function; initializing the hash 8 given hash function; initializing the hash
9 using the given binary data. 9 using the given binary data.
10 10
11 Named constructor functions are also available, these are faster 11 Named constructor functions are also available, these are faster
12 than using new(name): 12 than using new(name):
13 13
14 md5(), sha1(), sha224(), sha256(), sha384(), and sha512() 14 md5(), sha1(), sha224(), sha256(), sha384(), sha512(), blake2b(), and blake2s()
15
16 On platforms with support for 64bit integer types (some 32bit platforms,
17 all 64bit platforms), blake2b and blake2s are supported.
18 15
19 More algorithms may be available on your platform but the above are guaranteed 16 More algorithms may be available on your platform but the above are guaranteed
20 to exist. See the algorithms_guaranteed and algorithms_available attributes 17 to exist. See the algorithms_guaranteed and algorithms_available attributes
21 to find out what algorithm names can be passed to new(). 18 to find out what algorithm names can be passed to new().
22 19
23 NOTE: If you want the adler32 or crc32 hash functions they are available in 20 NOTE: If you want the adler32 or crc32 hash functions they are available in
24 the zlib module. 21 the zlib module.
25 22
26 Choose your hash function wisely. Some have known collision weaknesses. 23 Choose your hash function wisely. Some have known collision weaknesses.
27 sha384 and sha512 will be slow on 32 bit platforms. 24 sha384 and sha512 will be slow on 32 bit platforms.
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 try: 220 try:
224 globals()[__func_name] = __get_hash(__func_name) 221 globals()[__func_name] = __get_hash(__func_name)
225 except ValueError: 222 except ValueError:
226 import logging 223 import logging
227 logging.exception('code for hash %s was not found.', __func_name) 224 logging.exception('code for hash %s was not found.', __func_name)
228 225
229 226
230 # Cleanup locals() 227 # Cleanup locals()
231 del __always_supported, __func_name, __get_hash 228 del __always_supported, __func_name, __get_hash
232 del __py_new, __hash_new, __get_openssl_constructor 229 del __py_new, __hash_new, __get_openssl_constructor
LEFTRIGHT

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