Crc32.NET icon indicating copy to clipboard operation
Crc32.NET copied to clipboard

support chaining style code

Open Newp opened this issue 5 years ago • 1 comments

as-is

var crc = CrcAlgorithm.CreateCrc16CcittFalse();

// Give it some bytes to chew on - you can call this multiple times if needed
crc.Append(Encoding.ASCII.GetBytes("Hurray for cake!"));

// Get the output - as a hex string, byte array or unsigned integer
Console.WriteLine(crc.ToHexString());

to-be

var crc = CrcAlgorithm
.CreateCrc16CcittFalse()
.Append(Encoding.ASCII.GetBytes("Hurray for cake!"));

Console.WriteLine(crc.ToHexString());

Newp avatar Oct 20 '20 09:10 Newp

This would be useful, explicitly in my use-case to be doing CRC of multiple files and get a single unique number

DATEx2 avatar Apr 27 '25 22:04 DATEx2