Multiply by 1000003 instead of 3 in string hach

This commit is contained in:
Guido van Rossum 1996-09-11 20:22:48 +00:00
parent b23a60fd6e
commit eddcb3bae1

View file

@ -419,7 +419,7 @@ string_hash(a)
p = (unsigned char *) a->ob_sval;
x = *p << 7;
while (--len >= 0)
x = (3*x) ^ *p++;
x = (1000003*x) ^ *p++;
x ^= a->ob_size;
if (x == -1)
x = -2;