spaolacci / murmur3

Native MurmurHash3 Go implementation
BSD 3-Clause "New" or "Revised" License
947 stars 127 forks source link

Difference between C++ and Go output #11

Open panamafrancis opened 8 years ago

panamafrancis commented 8 years ago

I've been running both the C++ and this version of Murmur3 side by side and i've noticed that in cases where a null byte occurs in the middle of the input data, the C++ version will output a different hash.

Now I guess this is a bug in the C++ implementation, as Go will iterate over the correct array length, and not just stop at a null byte. But, given that the C++ version is the "official" one, should this version implement the bug as a feature?

spaolacci commented 7 years ago

Well, I doubt there's a bug in the original implementation ;), but I could use a reproducer (with the C++ version you're using).

I would suspect an API misusage given the C/C++ null byte specific signification.

Thanks.