IEntry.Crc returns a negative number
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
using SharpCompress.Archives;
var filePath = @"D:\001\001.gz";
using var stream = File.OpenRead(filePath);
var archive = ArchiveFactory.Open(stream);
foreach (var p in archive.Entries)
{
var data = p.Crc;
var text = data.ToString("X");
Console.WriteLine(text);
}
Test Result:
FFFFFFFFD8BF5DCD
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?
I've fixed this and will submit a fix.
@Nanook Thank you very much.