Skip to content

Commit

Permalink
pythongh-99502: mention bytes-like objects as input in `secrets.compa…
Browse files Browse the repository at this point in the history
…re_digest` (pythonGH-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.
  • Loading branch information
sobolevn authored Nov 26, 2022
1 parent ec2b76a commit 47d673d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Doc/library/secrets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ Other functions

.. function:: compare_digest(a, b)

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

0 comments on commit 47d673d

Please sign in to comment.