Index: Objects/tupleobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/tupleobject.c,v retrieving revision 2.90 diff -c -r2.90 tupleobject.c *** Objects/tupleobject.c 21 Mar 2004 22:29:05 -0000 2.90 --- Objects/tupleobject.c 19 May 2004 22:20:16 -0000 *************** *** 259,276 **** static long tuplehash(PyTupleObject *v) { register long x, y; register int len = v->ob_size; register PyObject **p; ! x = 0x345678L; p = v->ob_item; while (--len >= 0) { y = PyObject_Hash(*p++); if (y == -1) return -1; ! x = (1000003*x) ^ y; } - x ^= v->ob_size; if (x == -1) x = -2; return x; --- 259,300 ---- static long tuplehash(PyTupleObject *v) { + /* The following values are copied from Modules/md5c.c, + except that each value is replaced by a nearby prime. + */ + static long tbl[64] = { + 0xd76aa471, 0xe8c7b75f, 0x242070c1, 0xc1bdceeb, + 0xf57c0fb9, 0x4787c62d, 0xa830460f, 0xfd46951f, + 0x698098e5, 0x8b44f799, 0xffff5bc1, 0x895cd7cb, + 0x6b901133, 0xfd987195, 0xa6794385, 0x49b4082f, + + 0xf61e256d, 0xc040b359, 0x265e5a55, 0xe9b6c7a7, + 0xd62f1055, 0x2441449, 0xd8a1e68b, 0xe7d3fbd1, + 0x21e1ce05, 0xc33707e7, 0xf4d50d81, 0x455a14ef, + 0xa9e3e8fd, 0xfcefa3fd, 0x676f02cb, 0x8d2a4c93, + + 0xfffa3939, 0x8771f675, 0x6d9d611f, 0xfde53809, + 0xa4beea49, 0x4bdecf9d, 0xf6bb4b69, 0xbebfbc69, + 0x289b7edd, 0xeaa1281d, 0xd4ef3073, 0x4881d09, + 0xd9d4d04b, 0xe6db99d1, 0x1fa27d0b, 0xc4ac5669, + + 0xf4292249, 0x432aff9d, 0xab9423a9, 0xfc93a03f, + 0x655b59c5, 0x8f0ccc87, 0xffeff483, 0x85845ddf, + 0x6fa87e53, 0xfe2ce6df, 0xa3014337, 0x4e0811a5, + 0xf7537e67, 0xbd3af231, 0x2ad7d2b9, 0xeb86d393 + }; + register long x, y; register int len = v->ob_size; register PyObject **p; ! x = 0x345678L ^ len; p = v->ob_item; while (--len >= 0) { y = PyObject_Hash(*p++); if (y == -1) return -1; ! x = tbl[len & 0x3f] * (++x ^ y); } if (x == -1) x = -2; return x;