Fast, SIMD-accelerated CRC-32/ISO-HDLC (aka crc32) checksum computation in Rust exposed as a C-compatible shared library.
Results in a dramatic performance improvement. For example, when using it via FFI in PHP, it's >10X faster than PHP's native crc32 implementation.
See the change log.
cargo build will produce a shared library target (.so on Linx, .dll on Windows, .dylib on macOS, etc) and a C header file.
Use the header file and library as you would normally when using a shared library in your language of choice.
/** \FFI $ffi */
$hasher = $ffi->hasher_new();
$ffi->hasher_write($hasher, 'hello world!', 12);
$checksum = $ffi->hasher_finalize($hasher); // 0x03b4c26d- crc32fast - The underlying Rust library which implemented this SIMD-accelerated approach.
- crc-fast-php - An implementation of this library in PHP using FFI.
- crc64fast-nvme - A similar project which computes CRC-64/NVME checksums at >20GiB/s, also with a C-compatible shared library.