Claudenw commented on issue #27: Murmur3fix URL: https://github.com/apache/commons-codec/pull/27#issuecomment-554630047 The 128 bit was broken, the 32 bit was not, the 64 bit is not covered in the original murmurhash implementation. I brought across the implementation from Yonik Seeley and the tests that go with it. I duplicated the existing 128 bit tests calling the new 128 hash and and renamed them with "_x86" in the middle (e.g. test128_Double became test128_x64_Double) to verify that all the old tests passed the new hash. The "testCorrectValues_x64" (which I now realize is misnamed) verifies that the 32_x86 and 128_x64 return the expected results when compared with the results of the original "C" implementation. If you modify the testCorrectValues_x86 code to call the original hash32 and hash128 version you will see that the 128 version fails because of the sign extension that occurs early in the process. (This is what I showed in the original bug) The effective change is at lines 1047 and 1048. I provided new names for the standard hash methods as there are x86 and x64 versions of the hashes and they do **not** produce the same values. The change of Hash32 to Hash32_x86 makes it clear which hash it is. The change from Hash128 to Hash128_x64 does the same. While the old Hash128 is incorrectly implemented it has been released and is in the wild, so we have to expect that some uses of the hash128 function can not change to hash128_x64. To this end the hash128 functions are deprecated (but will probably not be removed) and new implementations are expected to use the hash128_x64 version. The Hash32 methods are deprecated to refer to the new names. Given that the code returns the same values one of the implementations could be removed and just call the other.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
