Expand description
§crc32fast-lib
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.
§Usage
§PHP example
$hasher = $ffi->hasher_new();
$ffi->hasher_write($hasher, 'hello world!', 12);
$checksum = $ffi->hasher_finalize($hasher); // 0x03b4c26d
Structs§
- Hasher
Handle - Opaque type for C for use in FFI
Functions§
- crc32_
hash - Helper method to just calculate a CRC32 checksum directly for a string
- hasher_
finalize ⚠ - Calculates the CRC32 checksum for data that’s been written to the Hasher
- hasher_
new - Creates a new Hasher to compute CRC32 checksums
- hasher_
write ⚠ - Writes data to the Hasher