GeezerVison is showing github.com — Clarify that dklen is expected in bytes for the hashlib functions (GH… · python/cpython@5adf78f
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: Doc/library/hashlib.rst +2-2Lines changed: 2 additions & 2 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -328,7 +328,7 @@ include a `salt <https://en.wikipedia.org/wiki/Salt_%28cryptography%29>`_. |
328 | 328 | your application, read *Appendix A.2.2* of NIST-SP-800-132_. The answers |
329 | 329 | on the `stackexchange pbkdf2 iterations question`_ explain in detail. |
330 | 330 |
|
331 | | - *dklen* is the length of the derived key. If *dklen* is ``None`` then the |
| 331 | + *dklen* is the length of the derived key in bytes. If *dklen* is ``None`` then the |
332 | 332 | digest size of the hash algorithm *hash_name* is used, e.g. 64 for SHA-512. |
333 | 333 |
|
334 | 334 | >>> from hashlib import pbkdf2_hmac |
@@ -357,7 +357,7 @@ include a `salt <https://en.wikipedia.org/wiki/Salt_%28cryptography%29>`_. |
357 | 357 |
|
358 | 358 | *n* is the CPU/Memory cost factor, *r* the block size, *p* parallelization |
359 | 359 | factor and *maxmem* limits memory (OpenSSL 1.1.0 defaults to 32 MiB). |
360 | | - *dklen* is the length of the derived key. |
| 360 | + *dklen* is the length of the derived key in bytes. |
361 | 361 |
|
362 | 362 | .. versionadded:: 3.6 |
363 | 363 |
|
|