| Crates.io | crc32fast-lib |
| lib.rs | crc32fast-lib |
| version | 1.0.1 |
| created_at | 2024-12-27 23:40:21.613483+00 |
| updated_at | 2024-12-28 00:57:37.777053+00 |
| description | Fast, SIMD-accelerated CRC-32/ISO-HDLC (aka 'crc32') checksum computation in Rust exposed as a C-compatible shared library |
| homepage | |
| repository | https://github.com/awesomized/crc32fast-lib-rust |
| max_upload_size | |
| id | 1496749 |
| size | 11,757 |
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