[Python-checkins] python/dist/src/Objects tupleobject.c,2.92,2.93

rhettinger at users.sourceforge.net rhettinger at users.sourceforge.net
Thu Jun 10 14:39:37 EDT 2004


Update of /cvsroot/python/python/dist/src/Objects
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32483

Modified Files:
	tupleobject.c 
Log Message:
Add a final permutation step to the tuple hash function.

Prevents a collision pattern that occurs with nested tuples.
(Yitz Gale provided code that repeatably demonstrated the weakness.)



Index: tupleobject.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Objects/tupleobject.c,v
retrieving revision 2.92
retrieving revision 2.93
diff -C2 -d -r2.92 -r2.93
*** tupleobject.c	4 Jun 2004 06:35:20 -0000	2.92
--- tupleobject.c	10 Jun 2004 18:39:35 -0000	2.93
***************
*** 281,284 ****
--- 281,285 ----
  		mult += 82520L + len + len;
  	}
+ 	x += 97531L;
  	if (x == -1)
  		x = -2;




More information about the Python-checkins mailing list