mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-04 05:25:00 +00:00
IEntry.Crc returns a negative number #501
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Feb 26, 2022).
IEntry.Crc Property returns a negative number (eg: -1626075223).
When loading some .gz files, the CRC property will return a negative number. I'm not sure if negative numbers are currently the best solution for sharpcompress. But while converting this CRC to a string, an error occurs.
Test Code:
C# / .net 6.0 / Visual Studio 2022
Test Result:
String conversion has extra "FFFFFFFF" when CRC is negative number.
There is a detailed explanation about this part on stackoverflow.
https://stackoverflow.com/questions/32940417/unsigned-crc-32-for-python-to-match-javas-crc-32
Do you think it is necessary to normalize all CRCs to positive integers?
@Nanook commented on GitHub (Jul 15, 2022):
I've fixed this and will submit a fix.
@ghost commented on GitHub (Nov 19, 2022):
@Nanook Thank you very much.