Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

MurmurHash2, which is pretty great, has some issues:

"MurmurHash2_x86_64 computes two 32-bit results in parallel and mixes them at the end, which is fast but means that collision resistance is only as good as a 32-bit hash. I suggest avoiding this variant."[1]

Murmurhash3 has a 128-bit variant, which might be more along the lines of what he's looking for (the original post mentions SHA256).

1: http://code.google.com/p/smhasher/wiki/MurmurHash3



Computing two 32-bit results in parallel and mixing them at the end does NOT mean collision resistance is only as good as a 32-bit hash. For that, you need to compute ONE 32-bit result, then transform it into a 64-bit result.


Depends whether the two 32-bit hashes are correlated with each other. If there is no correlation then a pair of 32-bit hashes is no more likely to collide than a single 64-bit hash. But this is difficult to achieve, and you should not assume (for example) running the same algorithm twice with different initial states will produce uncorrelated hashes.


Very true.


I thought Google's CityHash - http://code.google.com/p/cityhash/source/browse/trunk/README - was their successor to the MurmurHash variants.


CityHash doesn't have a 32-bit variant to participate in the benchmark.

http://code.google.com/p/cityhash/issues/detail?id=2




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: