adler32-simd
SIMD-accelerated Adler-32 checksum for Rust.
Vectorized implementations for ARM64 NEON and x86/x86_64 SSSE3, with an automatic scalar fallback on other platforms. Zero dependencies and no_std compatible.
Usage
Add to Cargo.toml:
[]
= "0.1"
One-shot:
let checksum = adler32;
Streaming:
let mut hasher = new;
hasher.write;
hasher.write;
let checksum = hasher.checksum;
Adler32 also implements std::hash::Hasher (with the default std feature):
use Hasher;
let mut hasher = new;
hasher.write;
let checksum = hasher.finish; // returns u64
Features
| Feature | Default | Description |
|---|---|---|
std |
Yes | Enables runtime CPU feature detection and Hasher impl. Disable for no_std. |
To use in a no_std environment:
[]
= { = "0.1", = false }
When std is disabled, SIMD is used only if the target feature is enabled at compile time (e.g. -C target-feature=+neon). Otherwise the scalar fallback is used.
Platform support
| Architecture | Instruction set | Detection |
|---|---|---|
aarch64 |
NEON | Runtime (std) / compile-time (no_std) |
x86 / x86_64 |
SSSE3 | Runtime (std) / compile-time (no_std) |
| Everything else | Scalar | Automatic fallback |
License
MIT