multihash icon indicating copy to clipboard operation
multihash copied to clipboard

Murmur3-128 output differs between 32-bit and 64-bit implementations by design

Open mateon1 opened this issue 7 years ago • 2 comments

The current version is MurmurHash3, which yields a 32-bit or 128-bit hash value. When using 128-bits, the x86 and x64 versions do not produce the same values, as the algorithms are optimized for their respective platforms.


Source: Wikipedia

I think this is a major issue for a hashing function for multihash. I believe the idea is for the hash to be reproducible anywhere.

This could be fixed by splitting the Murmur3-128 multihash code into two, whether the 32 bit or 64 bit implementation is to be used.

Alternatively, Murmur could be removed, as it's an unsafe, non-cryptographic hash function, and I am not aware of anything that depends on a multihash library and uses murmur.

mateon1 avatar Aug 26 '17 20:08 mateon1

We use it when building HAMTs (hash maps). Not to build actual multihashes (<type><length><digest>) but just to indicate the hash function.

Stebalien avatar Dec 21 '18 01:12 Stebalien

However, you bring up a good point about the architecture dependence. I believe we're using murmur3-128x64.

Stebalien avatar Dec 21 '18 01:12 Stebalien