[issue14621] Hash function is not randomized properly

Vlado Boza report at bugs.python.org
Fri Apr 20 19:44:07 CEST 2012


Vlado Boza <usama at ksp.sk> added the comment:

One possible fix:
Look for StringHasher in google v8 code (http://code.google.com/p/v8/source/search?q=stringhasher&origq=stringhasher&btnG=Search+Trunk). Main loop looks like this:
raw_running_hash_ += c;                                                                       
raw_running_hash_ += (raw_running_hash_ << 10);                                               
raw_running_hash_ ^= (raw_running_hash_ >> 6);  

It seems not to have same collisions with many different hash seeds.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14621>
_______________________________________


More information about the Python-bugs-list mailing list