You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 13, 2022. It is now read-only.
Repository navigation
This repository was archived by the owner on May 13, 2022. It is now read-only.
xxHash sometimes doesn't match the Hash from the C library from Google #16
I need to be able to verify an xxHash64 that is being generated by another program. Sometimes the xxHash from this code doesn't match, and when I run the C code downloaded from google, it does. https://code.google.com/p/xxhash/
I stepped through the code along with the C++ code from google and I've found the issue.
xxHash.cs
In ComputeHashInternal() the dataCount variable should be a long instead of an int. On large files, it overflows into negative.
In PostProcess() you have an if statement "if ((remainder.Length % 8) > 4)" this ensures that your code for processing the last 4 bytes of a file will never be hit. It should be changed to " if ((remainder.Length % 8) == 4)".
After these two changes, everything seems to match.
I'll take a look at as soon as I can. If you know how to submit a pull request with the changes you talked about above, it could significantly help expedite the process.
Activity
illcom94 commentedon Aug 20, 2015
I stepped through the code along with the C++ code from google and I've found the issue.
xxHash.cs
After these two changes, everything seems to match.
illcom94 commentedon Aug 20, 2015
After running a few more files I had to make a modification to my #2 fix.
The if statement should be "if ((remainder.Length % 8) >= 4)"
brandondahler commentedon Aug 31, 2015
I'll take a look at as soon as I can. If you know how to submit a pull request with the changes you talked about above, it could significantly help expedite the process.
Issue #16 - xxHash Deviations
Issue #16 - xxHash Deviations
Issue #16 - xxHash Deviations
Merge pull request #17 from brandondahler/bugfix/xxHash
brandondahler commentedon Sep 27, 2015
This issue has been addressed in release 1.8.1.