simd-adler32
SIMD-accelerated Adler-32 checksum hashing for Rust, with zero dependencies and no_std support.
Repository Health
Technical Analysis
simd-adler32 is a dependency-free Rust crate that computes Adler-32 checksums at multi-gigabyte-per-second throughput by dispatching to hand-written SIMD implementations for AVX-512, AVX2, SSSE3, SSE2, ARM NEON, and WASM SIMD128. When the std feature is enabled it performs runtime CPU feature detection to pick the fastest available path, and it gracefully falls back to a scalar implementation when SIMD is unavailable.
With no_std support and no external dependencies, the crate is well suited to embedded targets, compression codecs, and anywhere a fast rolling checksum is needed. It powers Adler-32 checksumming in widely used Rust compression stacks and has been fuzzed with AFL across release and debug builds before publishing.
What You Get
- A simple
Adler32struct withnew,write, andfinishfor incremental checksumming - Hand-tuned SIMD backends for AVX-512, AVX2, SSSE3, SSE2, ARM NEON, and WASM SIMD128
- Runtime CPU feature detection (with
std) to auto-select the fastest available path - A scalar fallback so the crate works on any target, including
no_std - Zero external dependencies and a low minimum supported Rust version
Common Use Cases
- Computing Adler-32 checksums inside compression libraries such as zlib/DEFLATE implementations
- Verifying data integrity for large buffers where checksum speed matters
- Embedded or
no_stdprojects that need a fast checksum without pulling in dependencies
Under The Hood
Architecture - The public surface in src/lib.rs and src/hash.rs exposes an Adler32 accumulator whose update routine dispatches into src/imp/mod.rs, which selects a per-architecture backend (avx512.rs, avx2.rs, ssse3.rs, sse2.rs, neon.rs, wasm.rs) or the portable scalar.rs. With std, selection happens at runtime via CPU feature detection; in no_std builds the choice is made at compile time from target features.
Tech Stack - Pure Rust (edition 2018) with no runtime dependencies. It uses core::arch SIMD intrinsics behind unsafe, cargo features (std, nightly, const-generics) to gate capabilities, and dev-only criterion, rand, and competitor crates for benchmarking.
Code Quality - The code is compact and organized one file per instruction set behind a common interface. The unsafe intrinsic paths are validated by an AFL fuzzing harness under fuzz/ run on release and debug builds before publishing, and Criterion benchmarks under bench/ guard performance against alternative crates.
API Design - The API is minimal and idiomatic: construct an Adler32, write bytes incrementally, then finish for the checksum, mirroring the standard Hasher mental model. Feature flags keep the default ergonomic while allowing no_std and older-toolchain builds with a one-line dependency tweak.