Uploaded image for project: 'Commons Codec'
  1. Commons Codec
  2. CODEC-264

murmur3.hash128() does not account for unsigned seed argument

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.13
    • Fix Version/s: 1.14
    • Labels:
      None

      Description

      The original murmur3_x64_128 code used unsigned int for seed arguments. Using the equivalent bit patterns in the commons codec version does not yield the same results.

      I believe this is because the commons version does not account for sign extension etc.

      Yonic Seeley Yonik Seeley has explains the issue in his implementation https://github.com/yonik/java_util/blob/master/src/util/hash/MurmurHash3.java

      He provides a test case to show that his code returns the same answers as the original C/C++ code. I modified that test to call the codec version to show the error.

      I have attached that test case.

      Given that the original code is in the wild I am uncertain how to fix this issue.

        Attachments

        1. YonikMurmur3Tests.java
          6 kB
          Claude Warren

          Issue Links

            Activity

              People

              • Assignee:
                aherbert Alex Herbert
                Reporter:
                claude Claude Warren
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: