From: Guido van Rossum Date: Wed, 11 Sep 1996 20:22:48 +0000 (+0000) Subject: Multiply by 1000003 instead of 3 in string hach X-Git-Tag: v1.4~222 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=eddcb3bae10f057a1483386d8fc17487b03d9145;p=thirdparty%2FPython%2Fcpython.git Multiply by 1000003 instead of 3 in string hach --- diff --git a/Objects/stringobject.c b/Objects/stringobject.c index 1e11c503cb28..3dfe1154876d 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -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;