Skip to content

Commit 47d673d

Browse files
authored
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.html#hmac.compare_digest It is the same function, just re-exported. So, I guess they should mention the same input types.
1 parent ec2b76a commit 47d673d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Doc/library/secrets.rst

+3-1
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)