FFT.CRC
A fast, allocation-free implementation for incrementally calculating a CRC32 value on a stream of data slices as each slice becomes available.
Features
CRC32Builder: Allows you to add data one slice at a time as it becomes available, keeping a running total of the CRC32 calculation. Once all data has arrived, the final CRC32 value is provided.CRC32Calculator: Exposes low-level methods for making your own CRC32 calculations without theCRC32Builderfeature.
Quickstarts
using System;
using FFT.CRC;
// get an INITIALIZED builder struct
var crcBuilder = CRC32Builder.InitializedValue;
// add each data segment
foreach(ReadOnlySpan<byte> segment in data)
crcBuilder.Add(segment);
// get the final calculation result
var crcValue = crcBuilder.Value;
// optionally reset the builder ready for new data
crcBuilder.Initialize();