-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[System.IO.Hashing] crc32 hash does not match #76720
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
It looks like the endianness is backward. The bytes are backward.
According to the .NET docs:
I suspect those other tools are showing the CRC32 value in big endian. I think you just need to reverse the bytes: var checkSum = crc32.GetCurrentHash();
Array.Reverse(checkSum);
var hash = BitConverter.ToString(checkSum).Replace("-", "").ToLower(); |
Tagging subscribers to this area: @dotnet/area-system-io Issue DetailsHi I tried this library (Version 6.0.2 in net 6 project). And the result it gives is wrong. For comparison
|
Hi I tried this library (Version 6.0.2 in net 6 project). And the result it gives is wrong. For comparison
HashTab result: B8FF80ED
![image](https://user-images.githubusercontent.com/73015418/194400683-5174e9ec-b094-4802-a53f-f9a42d6315f8.png)
php result: B8FF80ED
The text was updated successfully, but these errors were encountered: