Skip to content

Support for stream #12

Open
Open
@angedelamort

Description

@angedelamort

I was wondering if you could add support for FileStream (or Stream in general)?

Since we usually use files for computing the CRC, I find it annoying to load the file in memory in order to get all the bytes. When you have big files, it's not really good practice. And I saw that most of libraries use the same interface as yours.

So, that's what I can do right now:

var bytes = File.ReadAllBytes(path);
var crc32 = Crc32Algorithm.Compute(bytes);

What would be nice:

using (var stream = new FileStream(path, FileMode.Open))
{
    var crc32 = Crc32Algorithm.Compute(stream);
}

Thanks

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions