adler32-simd 0.1.0

SIMD-accelerated Adler-32 checksum with ARM NEON and x86 SSSE3 support
Documentation
  • Coverage
  • 37.5%
    3 out of 8 items documented1 out of 8 items with examples
  • Size
  • Source code size: 17.41 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.59 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 12s Average build duration of successful builds.
  • all releases: 12s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • euceph/adler32-simd
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • euceph

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:

[dependencies]
adler32-simd = "0.1"

One-shot:

let checksum = adler32_simd::adler32(b"Hello, world!");

Streaming:

let mut hasher = adler32_simd::Adler32::new();
hasher.write(b"Hello, ");
hasher.write(b"world!");
let checksum = hasher.checksum();

Adler32 also implements std::hash::Hasher (with the default std feature):

use std::hash::Hasher;

let mut hasher = adler32_simd::Adler32::new();
hasher.write(b"data");
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:

[dependencies]
adler32-simd = { version = "0.1", default-features = 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