Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add .. versionadded::
  • Loading branch information
picnixz committed Nov 7, 2025
commit 2443931a85e9a4bb8822168c24d45738fd1f2416
9 changes: 8 additions & 1 deletion Doc/c-api/hash.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,19 @@ See also the :c:member:`PyTypeObject.tp_hash` member and :ref:`numeric-hash`.

The algorithm name is exposed by :data:`sys.hash_info.algorithm`.

.. versionadded:: 3.4

.. c:macro:: Py_HASH_FNV
Py_HASH_SIPHASH13
Py_HASH_SIPHASH24
Py_HASH_SIPHASH13

Numerical values to compare to :c:macro:`Py_HASH_ALGORITHM` to determine
which algorithm is used for hashing. The hash algorithm can be configured
via the configure :option:`--with-hash-algorithm` option.

.. versionadded:: 3.11
Add :c:macro:`!Py_HASH_SIPHASH13`.

.. c:macro:: Py_HASH_CUTOFF

Buffers of length in range ``[1, Py_HASH_CUTOFF)`` are hashed using DJBX33A
Expand All @@ -44,6 +49,8 @@ See also the :c:member:`PyTypeObject.tp_hash` member and :ref:`numeric-hash`.
it is easier to create colliding strings. A cutoff of 7 on 64-bit platforms
and 5 on 32-bit platforms should provide a decent safety margin.

.. versionadded:: 3.4

.. c:macro:: PyHASH_MODULUS

The `Mersenne prime <https://en.wikipedia.org/wiki/Mersenne_prime>`_ ``P = 2**n -1``,
Expand Down