Skip to content

Commit 5adf78f

Browse files
authored
Clarify that dklen is expected in bytes for the hashlib functions (GH-106624)
1 parent 31d61a7 commit 5adf78f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/library/hashlib.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ include a `salt <https://en.wikipedia.org/wiki/Salt_%28cryptography%29>`_.
328328
your application, read *Appendix A.2.2* of NIST-SP-800-132_. The answers
329329
on the `stackexchange pbkdf2 iterations question`_ explain in detail.
330330

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
332332
digest size of the hash algorithm *hash_name* is used, e.g. 64 for SHA-512.
333333

334334
>>> from hashlib import pbkdf2_hmac
@@ -357,7 +357,7 @@ include a `salt <https://en.wikipedia.org/wiki/Salt_%28cryptography%29>`_.
357357

358358
*n* is the CPU/Memory cost factor, *r* the block size, *p* parallelization
359359
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.
361361

362362
.. versionadded:: 3.6
363363

0 commit comments

Comments
 (0)