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 compatibility with other libraries #71

Open
dhulchuk opened this issue Apr 30, 2024 · 0 comments
Open

murmur3 compatibility with other libraries #71

dhulchuk opened this issue Apr 30, 2024 · 0 comments

Comments

@dhulchuk
Copy link

In case someone is locked to this not maintained package due to different behaviour of murmur3_32 on strings.
You can get the same hash by adding zero byte after every symbol.
Example for mmh3 library:

import pyhash
import mmh3

zero_spaced_string = ''.join(x + '\x00' for x in original_string)
assert mmh3.hash(zero_spaced_string, signed=False) == pyhash.murmur3_32()(original_string)

This may not be general solution, but it works for my setup.

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

1 participant