Murmurhash 2 results on Python and Haskell -


haskell , python don't seem agree on murmurhash2 results. python, java, , php returned same results haskell don't. doing wrong regarding murmurhash2 on haskell?

here code haskell murmurhash2:

import data.digest.murmur32      main =     print $ asword32 $ hash32withseed 1 "woohoo" 

and here code written in python:

import murmur  if __name__ == "__main__":     print murmur.string_hash("woohoo", 1) 

python returned 3650852671 while haskell returned 3966683799

the murmur-hash package (i author) not promise compute same hashes other languages. if rely on hashes compatible other software computes hashes suggest create newtype wrappers compute hashes way want them. text, in particular, need @ least specify encoding. in case convert text ascii string using data.bytestring.char8.pack, still doesn't give same hash since bytestring instance more of placeholder.

btw, i'm not actively improving package because murmurhash2 has been superseded murmurhash3, keep accepting patches.


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -