I have a need to MurmurHash strings in both Python and Scala. However they are giving very different results. Scala's builtin MurmurHash3
library does not seem to give the same results as any of the other libraries I have tried including online ones. The odd thing is it seems to match on a single character but not multiple characters. Here are some examples:
Python:
mmh3.hash('string', 0)
res: -1390314837
Scala:
MurmurHash3.stringHash("string", 0)
res: 379569354
I have tried playing with signed and unsigned ints as I know Java has signed and the C implementation python is wrapping is using unsigned. But even using NumPy to convert to a signed int gives us no help. This website seems to agree with the python implementation:
http://murmurhash.shorelabs.com/
Any ideas on what could be going on here?