multihash
multihash copied to clipboard
Murmur3-128 output differs between 32-bit and 64-bit implementations by design
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.
We use it when building HAMTs (hash maps). Not to build actual multihashes (<type><length><digest>
) but just to indicate the hash function.
However, you bring up a good point about the architecture dependence. I believe we're using murmur3-128x64.