Crates.io | crc32-xfer-fast |
lib.rs | crc32-xfer-fast |
version | 0.4.0 |
source | src |
created_at | 2024-10-20 21:59:04.761414 |
updated_at | 2024-11-07 23:15:40.982689 |
description | SIMD-powered implementation of CRC-32/XFER |
homepage | |
repository | https://github.com/TobiasBengtsson/crc-fast-rs |
max_upload_size | |
id | 1416679 |
size | 8,008 |
SIMD implementation of CRC-32/XFER, with table and loop fallbacks.
This crate was generated by crc-fast-rs.
TL;DR: uses SIMD if available, otherwise falls back seamlessly to a lookup table algorithm.
hash
, will use SIMD if the CPU is capable
pclmulqdq
sse4.1
nano
aes
hash
with an incompatible CPU the fallback algorithm will be
invoked. If the table-fallback
feature is active the fallback is based on
a lookup table, otherwise a simple loop (slowest option). Deactivating
table-fallback
(default enabled) can be useful when memory is very scarce,
as the lookup table requires a small amount of extra RAM.table-fallback
feature is enabled, it can be manually invoked by
hash_table
(not recommended in the typical case).hash_simple
can be used to force the loop algorithm (also not
recommended in the typical case).let res: u32 = crc32_xfer_fast::hash(&my_binary_slice);
There is no "update"-like functionality yet, since doing this with arbitrarily lengths can be tricky with SIMD and destroy performance.