mirror of
https://github.com/adamhathcock/sharpcompress.git
synced 2026-02-08 13:34:57 +00:00
IEntry.Crc returns a negative number #497
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?