Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ExeBy/smexe_ro.../usr/include/python3....
File: pyhash.h
#ifndef Py_HASH_H
[0] Fix | Delete
[1] Fix | Delete
#define Py_HASH_H
[2] Fix | Delete
#ifdef __cplusplus
[3] Fix | Delete
extern "C" {
[4] Fix | Delete
#endif
[5] Fix | Delete
[6] Fix | Delete
/* Helpers for hash functions */
[7] Fix | Delete
#ifndef Py_LIMITED_API
[8] Fix | Delete
PyAPI_FUNC(Py_hash_t) _Py_HashDouble(double);
[9] Fix | Delete
PyAPI_FUNC(Py_hash_t) _Py_HashPointer(void*);
[10] Fix | Delete
PyAPI_FUNC(Py_hash_t) _Py_HashBytes(const void*, Py_ssize_t);
[11] Fix | Delete
#endif
[12] Fix | Delete
[13] Fix | Delete
/* Prime multiplier used in string and various other hashes. */
[14] Fix | Delete
#define _PyHASH_MULTIPLIER 1000003UL /* 0xf4243 */
[15] Fix | Delete
[16] Fix | Delete
/* Parameters used for the numeric hash implementation. See notes for
[17] Fix | Delete
_Py_HashDouble in Python/pyhash.c. Numeric hashes are based on
[18] Fix | Delete
reduction modulo the prime 2**_PyHASH_BITS - 1. */
[19] Fix | Delete
[20] Fix | Delete
#if SIZEOF_VOID_P >= 8
[21] Fix | Delete
# define _PyHASH_BITS 61
[22] Fix | Delete
#else
[23] Fix | Delete
# define _PyHASH_BITS 31
[24] Fix | Delete
#endif
[25] Fix | Delete
[26] Fix | Delete
#define _PyHASH_MODULUS (((size_t)1 << _PyHASH_BITS) - 1)
[27] Fix | Delete
#define _PyHASH_INF 314159
[28] Fix | Delete
#define _PyHASH_NAN 0
[29] Fix | Delete
#define _PyHASH_IMAG _PyHASH_MULTIPLIER
[30] Fix | Delete
[31] Fix | Delete
[32] Fix | Delete
/* hash secret
[33] Fix | Delete
*
[34] Fix | Delete
* memory layout on 64 bit systems
[35] Fix | Delete
* cccccccc cccccccc cccccccc uc -- unsigned char[24]
[36] Fix | Delete
* pppppppp ssssssss ........ fnv -- two Py_hash_t
[37] Fix | Delete
* k0k0k0k0 k1k1k1k1 ........ siphash -- two uint64_t
[38] Fix | Delete
* ........ ........ ssssssss djbx33a -- 16 bytes padding + one Py_hash_t
[39] Fix | Delete
* ........ ........ eeeeeeee pyexpat XML hash salt
[40] Fix | Delete
*
[41] Fix | Delete
* memory layout on 32 bit systems
[42] Fix | Delete
* cccccccc cccccccc cccccccc uc
[43] Fix | Delete
* ppppssss ........ ........ fnv -- two Py_hash_t
[44] Fix | Delete
* k0k0k0k0 k1k1k1k1 ........ siphash -- two uint64_t (*)
[45] Fix | Delete
* ........ ........ ssss.... djbx33a -- 16 bytes padding + one Py_hash_t
[46] Fix | Delete
* ........ ........ eeee.... pyexpat XML hash salt
[47] Fix | Delete
*
[48] Fix | Delete
* (*) The siphash member may not be available on 32 bit platforms without
[49] Fix | Delete
* an unsigned int64 data type.
[50] Fix | Delete
*/
[51] Fix | Delete
#ifndef Py_LIMITED_API
[52] Fix | Delete
typedef union {
[53] Fix | Delete
/* ensure 24 bytes */
[54] Fix | Delete
unsigned char uc[24];
[55] Fix | Delete
/* two Py_hash_t for FNV */
[56] Fix | Delete
struct {
[57] Fix | Delete
Py_hash_t prefix;
[58] Fix | Delete
Py_hash_t suffix;
[59] Fix | Delete
} fnv;
[60] Fix | Delete
/* two uint64 for SipHash24 */
[61] Fix | Delete
struct {
[62] Fix | Delete
uint64_t k0;
[63] Fix | Delete
uint64_t k1;
[64] Fix | Delete
} siphash;
[65] Fix | Delete
/* a different (!) Py_hash_t for small string optimization */
[66] Fix | Delete
struct {
[67] Fix | Delete
unsigned char padding[16];
[68] Fix | Delete
Py_hash_t suffix;
[69] Fix | Delete
} djbx33a;
[70] Fix | Delete
struct {
[71] Fix | Delete
unsigned char padding[16];
[72] Fix | Delete
Py_hash_t hashsalt;
[73] Fix | Delete
} expat;
[74] Fix | Delete
} _Py_HashSecret_t;
[75] Fix | Delete
PyAPI_DATA(_Py_HashSecret_t) _Py_HashSecret;
[76] Fix | Delete
#endif
[77] Fix | Delete
[78] Fix | Delete
#ifdef Py_DEBUG
[79] Fix | Delete
PyAPI_DATA(int) _Py_HashSecret_Initialized;
[80] Fix | Delete
#endif
[81] Fix | Delete
[82] Fix | Delete
[83] Fix | Delete
/* hash function definition */
[84] Fix | Delete
#ifndef Py_LIMITED_API
[85] Fix | Delete
typedef struct {
[86] Fix | Delete
Py_hash_t (*const hash)(const void *, Py_ssize_t);
[87] Fix | Delete
const char *name;
[88] Fix | Delete
const int hash_bits;
[89] Fix | Delete
const int seed_bits;
[90] Fix | Delete
} PyHash_FuncDef;
[91] Fix | Delete
[92] Fix | Delete
PyAPI_FUNC(PyHash_FuncDef*) PyHash_GetFuncDef(void);
[93] Fix | Delete
#endif
[94] Fix | Delete
[95] Fix | Delete
[96] Fix | Delete
/* cutoff for small string DJBX33A optimization in range [1, cutoff).
[97] Fix | Delete
*
[98] Fix | Delete
* About 50% of the strings in a typical Python application are smaller than
[99] Fix | Delete
* 6 to 7 chars. However DJBX33A is vulnerable to hash collision attacks.
[100] Fix | Delete
* NEVER use DJBX33A for long strings!
[101] Fix | Delete
*
[102] Fix | Delete
* A Py_HASH_CUTOFF of 0 disables small string optimization. 32 bit platforms
[103] Fix | Delete
* should use a smaller cutoff because it is easier to create colliding
[104] Fix | Delete
* strings. A cutoff of 7 on 64bit platforms and 5 on 32bit platforms should
[105] Fix | Delete
* provide a decent safety margin.
[106] Fix | Delete
*/
[107] Fix | Delete
#ifndef Py_HASH_CUTOFF
[108] Fix | Delete
# define Py_HASH_CUTOFF 0
[109] Fix | Delete
#elif (Py_HASH_CUTOFF > 7 || Py_HASH_CUTOFF < 0)
[110] Fix | Delete
# error Py_HASH_CUTOFF must in range 0...7.
[111] Fix | Delete
#endif /* Py_HASH_CUTOFF */
[112] Fix | Delete
[113] Fix | Delete
[114] Fix | Delete
/* hash algorithm selection
[115] Fix | Delete
*
[116] Fix | Delete
* The values for Py_HASH_SIPHASH24 and Py_HASH_FNV are hard-coded in the
[117] Fix | Delete
* configure script.
[118] Fix | Delete
*
[119] Fix | Delete
* - FNV is available on all platforms and architectures.
[120] Fix | Delete
* - SIPHASH24 only works on plaforms that don't require aligned memory for integers.
[121] Fix | Delete
* - With EXTERNAL embedders can provide an alternative implementation with::
[122] Fix | Delete
*
[123] Fix | Delete
* PyHash_FuncDef PyHash_Func = {...};
[124] Fix | Delete
*
[125] Fix | Delete
* XXX: Figure out __declspec() for extern PyHash_FuncDef.
[126] Fix | Delete
*/
[127] Fix | Delete
#define Py_HASH_EXTERNAL 0
[128] Fix | Delete
#define Py_HASH_SIPHASH24 1
[129] Fix | Delete
#define Py_HASH_FNV 2
[130] Fix | Delete
[131] Fix | Delete
#ifndef Py_HASH_ALGORITHM
[132] Fix | Delete
# ifndef HAVE_ALIGNED_REQUIRED
[133] Fix | Delete
# define Py_HASH_ALGORITHM Py_HASH_SIPHASH24
[134] Fix | Delete
# else
[135] Fix | Delete
# define Py_HASH_ALGORITHM Py_HASH_FNV
[136] Fix | Delete
# endif /* uint64_t && uint32_t && aligned */
[137] Fix | Delete
#endif /* Py_HASH_ALGORITHM */
[138] Fix | Delete
[139] Fix | Delete
#ifdef __cplusplus
[140] Fix | Delete
}
[141] Fix | Delete
#endif
[142] Fix | Delete
[143] Fix | Delete
#endif /* !Py_HASH_H */
[144] Fix | Delete
[145] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function