Help with crc property #9

Open
opened 2026-01-29 22:03:27 +00:00 by claunia · 0 comments
Owner

Originally created by @cesarpeixoto on GitHub (Apr 16, 2014).

Sorry about my english

I'm trying to get the CRC32 of a file ownership. However, the return shows a wrong result. here's the code

Stream stream = File.OpenRead(@"C:\Test.rar");
var reader = ReaderFactory.Open(stream);
while(reader.MoveToNextEntry())
{
Label1.Content = reader.Entry.Crc.ToString();
}

The RAR file has only one file inside to test.
This code prints this value on label 4263732290 as if CRC

In Winrar, the value pointed to as CRC is FE236442, which is the same value I get when I calculate the uncompressed file.

then used the SevenZipSharp with the following code

SevenZipCompressor.SetLibraryPath(@"C:\7z.dll");
SevenZipExtractor zip = new SevenZipExtractor("Test.rar");
Label1.Content = zip.ArchiveFileData[0].Crc.ToString();

To my death, I got the same result (4263732290).
Is there something I'm doing wrong? I need to do another treatment with the warmth of the property to extract the calculation of CRC32??

Another thing I noticed in testing is that the other properties return the correct value (FilePath, CompressedSize, Size) everything works perfectly, minus the CRC32

Thanks for the help

Originally created by @cesarpeixoto on GitHub (Apr 16, 2014). Sorry about my english I'm trying to get the CRC32 of a file ownership. However, the return shows a wrong result. here's the code Stream stream = File.OpenRead(@"C:\Test.rar"); var reader = ReaderFactory.Open(stream); while(reader.MoveToNextEntry()) { Label1.Content = reader.Entry.Crc.ToString(); } The RAR file has only one file inside to test. This code prints this value on label 4263732290 as if CRC In Winrar, the value pointed to as CRC is FE236442, which is the same value I get when I calculate the uncompressed file. then used the SevenZipSharp with the following code SevenZipCompressor.SetLibraryPath(@"C:\7z.dll"); SevenZipExtractor zip = new SevenZipExtractor("Test.rar"); Label1.Content = zip.ArchiveFileData[0].Crc.ToString(); To my death, I got the same result (4263732290). Is there something I'm doing wrong? I need to do another treatment with the warmth of the property to extract the calculation of CRC32?? Another thing I noticed in testing is that the other properties return the correct value (FilePath, CompressedSize, Size) everything works perfectly, minus the CRC32 Thanks for the help
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#9