Message326334
> And one more:
x = (x * mult) ^ t;
also appears to work equally well.
The order of operations does not really matter: you can write the loop as
x *= mult # Appears only in FNV-1
x ^= t[0]
x *= mult
x ^= t[1]
x *= mult
x ^= t[2]
x *= mult
x ^= t[3]
x *= mult # Appears only in FNV-1a
The initial multiplication is equivalent to changing the initial value and the final multiplication is just a permutation of the outputs. None of those should really affect the quality of the hash. |
|
Date |
User |
Action |
Args |
2018-09-25 08:51:51 | jdemeyer | set | recipients:
+ jdemeyer, tim.peters, rhettinger, mark.dickinson, eric.smith, sir-sigurd |
2018-09-25 08:51:51 | jdemeyer | set | messageid: <1537865511.33.0.545547206417.issue34751@psf.upfronthosting.co.za> |
2018-09-25 08:51:51 | jdemeyer | link | issue34751 messages |
2018-09-25 08:51:51 | jdemeyer | create | |
|