ExtractAllEntries doesn't produce correct CRC info #695

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

Originally created by @Kimi-Arthur on GitHub (Aug 15, 2025).

Example code using latest 0.40.0:

using System;
using System.Linq;
using SharpCompress.Archives;

namespace SharpCompressIssue;

class Program {
    static void Main(string[] args) {
        var archive = ArchiveFactory.Open("a.part01.rar");
        Console.WriteLine("Entries:");
        foreach (var entry in archive.Entries.Where(entry => !entry.IsDirectory)
                     .Select(entry => entry.Crc)) {
            Console.WriteLine($"\t{entry}");
        }

        Console.WriteLine("ExtractAllEntries:");
        using var reader = archive.ExtractAllEntries();

        while (reader.MoveToNextEntry()) {
            var entry = reader.Entry;
            if (!entry.IsDirectory) {
                Console.WriteLine($"\t{entry.Crc}");
            }
        }
    }
}

Expected to find same list of CRC printed twice, but found:

Entries:
	3024952638
	2836867617
	2271334537
	3102882226
ExtractAllEntries:
	3653516404
	0
	0
	2012975541

Full example here with split part rar files.

Originally created by @Kimi-Arthur on GitHub (Aug 15, 2025). Example code using latest 0.40.0: ```cs using System; using System.Linq; using SharpCompress.Archives; namespace SharpCompressIssue; class Program { static void Main(string[] args) { var archive = ArchiveFactory.Open("a.part01.rar"); Console.WriteLine("Entries:"); foreach (var entry in archive.Entries.Where(entry => !entry.IsDirectory) .Select(entry => entry.Crc)) { Console.WriteLine($"\t{entry}"); } Console.WriteLine("ExtractAllEntries:"); using var reader = archive.ExtractAllEntries(); while (reader.MoveToNextEntry()) { var entry = reader.Entry; if (!entry.IsDirectory) { Console.WriteLine($"\t{entry.Crc}"); } } } } ``` Expected to find same list of CRC printed twice, but found: ``` Entries: 3024952638 2836867617 2271334537 3102882226 ExtractAllEntries: 3653516404 0 0 2012975541 ``` Full example [here](https://drive.google.com/file/d/1vumyjtK2znGjEZ3ybPwolVZOHxJd0iED/view?usp=sharing) with split part rar files.
claunia added the bugup for grabs labels 2026-01-29 22:16:02 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#695