CRC-32C (Castagnoli) for C++ and .NET

Introduction

Welcome! Here you can find hardware-accelerated implementation of CRC-32C (Castagnoli) for Windows (C++ and .NET). Intel's CRC32 instruction is used if available. Otherwise this library uses super fast software fallback.

.NET Framework doesn't provide any CRC algorithms and existing opensource libraries contain suboptimal algorithms. Creating really fast CRC algorithm is hard. This library encapsulates all that complexity for you and offers you a neat, simple API, so that every application can now afford fast CRC algorithm.

Note on CRC variants

Don't confuse CRC-32C (Castagnoli) with the older CRC-32 (also called CRC-32-IEEE). As you might know, CRC algorithm is defined by its so-called polynomial, essentially a 32-bit number. CRC-32C's polynomial can be seen in the box to the right.

Advantages of CRC-32C

The polynomial in CRC-32C was shown to have better error detection properties, which is the reason for its adoption in newer standards (iSCSI, SCTP, ext4).

Aside from higher reliability, CRC-32C now has the advantage of dedicated instruction on newer Intel processors. That's why it is being chosen for high-performance applications, for example Snappy compression algorithm.

Download

Continue to download section.

Project CRC-32C for C++ and .NET
Version 1.0.5
CRC type CRC-32C (Castagnoli)
Polynomial 0x1EDC6F41 / 0x82F63B78
CRC features configurable initial value, chainable, no pre/post-processing, continuous bit order
Optimizations Intel CRC32 instruction (x3) in hardware
Sliced table-driven software fallback
Performance 20 GB/s in hardware
2 GB/s in software
NuGet Crc32C (C++), Crc32C.NET (.NET)
Download crc32c-hw-1.0.5.7z (C++ and .NET)
Source code crc32c-hw and Crc32C.NET on Bitbucket
License BSD license, zlib license
Credits Robert Važan, Mark Adler