mirror of
https://github.com/python/cpython.git
synced 2026-01-08 08:22:41 +00:00
gh-111389: Add PyHASH_MULTIPLIER constant (#119214)
This commit is contained in:
parent
87939bd579
commit
f6da790122
7 changed files with 16 additions and 7 deletions
|
|
@ -3,7 +3,7 @@
|
|||
#endif
|
||||
|
||||
/* Prime multiplier used in string and various other hashes. */
|
||||
#define _PyHASH_MULTIPLIER 1000003UL /* 0xf4243 */
|
||||
#define PyHASH_MULTIPLIER 1000003UL /* 0xf4243 */
|
||||
|
||||
/* Parameters used for the numeric hash implementation. See notes for
|
||||
_Py_HashDouble in Python/pyhash.c. Numeric hashes are based on
|
||||
|
|
@ -17,9 +17,10 @@
|
|||
|
||||
#define PyHASH_MODULUS (((size_t)1 << _PyHASH_BITS) - 1)
|
||||
#define PyHASH_INF 314159
|
||||
#define PyHASH_IMAG _PyHASH_MULTIPLIER
|
||||
#define PyHASH_IMAG PyHASH_MULTIPLIER
|
||||
|
||||
/* Aliases kept for backward compatibility with Python 3.12 */
|
||||
#define _PyHASH_MULTIPLIER PyHASH_MULTIPLIER
|
||||
#define _PyHASH_BITS PyHASH_BITS
|
||||
#define _PyHASH_MODULUS PyHASH_MODULUS
|
||||
#define _PyHASH_INF PyHASH_INF
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue