Lines Matching refs:hash

1 /* Set of hash utility functions to help maintaining the invariant that
2 if a==b then hash(a)==hash(b)
34 /* For numeric types, the hash of a number x is based on the reduction
36 hash(x) == hash(y) whenever x and y are numerically equal, even if
51 (2) Now for a rational number x, define hash(x) by:
57 integers, floats and Decimals) then use the predefined hash value
62 NaNs hash with a pointer hash. Having distinct hash values prevents
64 have the same hash value but would compare unequal.
142 excessive hash collisions for dicts and sets */
162 We make the hash of the empty string be 0, rather than using
163 (prefix ^ suffix), since this slightly obfuscates the hash secret
176 Py_uhash_t hash;
178 hash = 5381; /* DJBX33A starts with 5381 */
181 /* ((hash << 5) + hash) + *p == hash * 33 + *p */
182 case 7: hash = ((hash << 5) + hash) + *p++; /* fallthrough */
183 case 6: hash = ((hash << 5) + hash) + *p++; /* fallthrough */
184 case 5: hash = ((hash << 5) + hash) + *p++; /* fallthrough */
185 case 4: hash = ((hash << 5) + hash) + *p++; /* fallthrough */
186 case 3: hash = ((hash << 5) + hash) + *p++; /* fallthrough */
187 case 2: hash = ((hash << 5) + hash) + *p++; /* fallthrough */
188 case 1: hash = ((hash << 5) + hash) + *p++; break;
192 hash ^= len;
193 hash ^= (Py_uhash_t) _Py_HashSecret.djbx33a.suffix;
194 x = (Py_hash_t)hash;
198 x = PyHash_Func.hash(src, len);
247 * Modified Fowler-Noll-Vo (FNV) hash function
265 /* Process at least one block byte by byte to reduce hash collisions
333 * Endian conversion not only ensures that the hash function returns the same
335 * the hash values' least significant bits.