]> granicus.if.org Git - python/commitdiff
Multiply by 1000003 instead of 3 in string hach
authorGuido van Rossum <guido@python.org>
Wed, 11 Sep 1996 20:22:48 +0000 (20:22 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 11 Sep 1996 20:22:48 +0000 (20:22 +0000)
Objects/stringobject.c

index 1e11c503cb282a926a631bd90515ed434a7f12ef..3dfe1154876daa6a391033ee784087d7fe5b18e0 100644 (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;