-
Notifications
You must be signed in to change notification settings - Fork 52
[question] Differrent values on other implementations (murmur3 32 bits) #24
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
Comments
It seems you use Python 3.x? I have reproduced the issue in Python 2.7, the unicode string will be hashed to 2085578581L. In [1]: import pyhash
In [2]: pyhash.murmur3_32()('foo')
Out[2]: 4138058784L
In [3]: pyhash.murmur3_32()(u'foo')
Out[3]: 2085578581L |
please try the latest git commit, it should be aligned in both Python 2.x and 3.x |
Yes, I was using python3, I will update here and test. Thanks. |
Hi, the syntax of numbers with L at the end does not work on python3: In [1]: import pyhash
Traceback (most recent call last):
File "/home/thomaz/projetos/thumbor/vpython-pyfasthash/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2963, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-1-6937f29f5d7b>", line 1, in <module>
import pyhash
File "/home/thomaz/projetos/thumbor/pyfasthash/pyhash.py", line 89
bytes_hash=3698262380L,
^
SyntaxError: invalid syntax |
I've tryed to just remove all "L" and seems to import fine, but doesn't works: In [1]: import pyhash
In [2]: pyhash.murmur3_32()('foo'.encode('ascii'))
Out[2]: 4138058784
In [3]: pyhash.murmur3_32()('foo')
Out[3]: 2085578581 |
sure, after you # https://github.com/flier/pyfasthash/issues/24
def testDefaultStringType(self):
hasher = murmur3_32()
self.assertEqual(hasher('foo'), hasher(u'foo'))
self.assertNotEqual(hasher('foo'), hasher(b'foo')) Besides, the |
Hi! |
In Python, Sorry about the wasted time, I will update the README soon, thanks. |
Hi!
I'm seeing different values when using other murmur libs in python, take a look:
I've also tried this online tool: http://murmurhash.shorelabs.com/ with the same 4138058784
hash value. Why the values from pyhash differs from other implementations? it's possible to get the same result?
Thanks!
The text was updated successfully, but these errors were encountered: