Skip to content

Commit 1fc2e2a

Browse files
[3.10] gh-99502: mention bytes-like objects as input in secrets.compare_digest (GH-99512) (#99790)
gh-99502: mention bytes-like objects as input in `secrets.compare_digest` (GH-99512) Now it is in sync with https://docs.python.org/3/library/hmac.htmlGH-hmac.compare_digest It is the same function, just re-exported. So, I guess they should mention the same input types. (cherry picked from commit 47d673d) Co-authored-by: Nikita Sobolev <[email protected]> Co-authored-by: Nikita Sobolev <[email protected]>
1 parent fae745e commit 1fc2e2a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Doc/library/secrets.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ Other functions
128128

129129
.. function:: compare_digest(a, b)
130130

131-
Return ``True`` if strings *a* and *b* are equal, otherwise ``False``,
131+
Return ``True`` if strings or
132+
:term:`bytes-like objects <bytes-like object>`
133+
*a* and *b* are equal, otherwise ``False``,
132134
using a "constant-time compare" to reduce the risk of
133135
`timing attacks <https://codahale.com/a-lesson-in-timing-attacks/>`_.
134136
See :func:`hmac.compare_digest` for additional details.

0 commit comments

Comments
 (0)