Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mateon1 opened this issue Aug 26, 2017 · 2 comments

Comments

@mateon1
Copy link

mateon1 commented Aug 26, 2017

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.

@Stebalien
Copy link
Member

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

@Stebalien
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants