Message326306
Just noting that this Bernstein-like variant appears to work as well as the FNV-1a version in all the goofy ;-) endcase tests I've accumulated:
while (--len >= 0) {
y = PyObject_Hash(*p++);
if (y == -1)
return -1;
Py_uhash_t t = (Py_uhash_t)y;
t ^= t << 7;
x = x * mult + t;
}
They're identical except for the last line. FNV-1a uses
x = (x ^ t) * mult;
instead. |
|
Date |
User |
Action |
Args |
2018-09-25 00:42:29 | tim.peters | set | recipients:
+ tim.peters, rhettinger, mark.dickinson, eric.smith, jdemeyer, sir-sigurd |
2018-09-25 00:42:29 | tim.peters | set | messageid: <1537836149.09.0.545547206417.issue34751@psf.upfronthosting.co.za> |
2018-09-25 00:42:29 | tim.peters | link | issue34751 messages |
2018-09-25 00:42:28 | tim.peters | create | |
|