Crate simd_adler32[][src]

Expand description


A SIMD-accelerated Adler-32 rolling hash algorithm implementation.


  • No dependencies
  • Support no_std (with default-features = false)
  • Runtime CPU feature detection (when std enabled)
  • Blazing fast performance on as many targets as possible (currently only x86 and x86_64)
  • Default to scalar implementation when simd not available

Quick start


simd-adler32 = "*"

use simd_adler32::Adler32;

let mut adler = Adler32::new();
adler.write(b"rust is pretty cool, man");
let hash = adler.finish();

println!("{}", hash);
// 1921255656

Feature flags

  • std - Enabled by default

Enables std support, see CPU Feature Detection for runtime detection support.

  • nightly

Enables nightly features required for avx512 support.

  • const-generics - Enabled by default

Enables const-generics support allowing for user-defined array hashing by value. See Adler32Hash for details.


CPU Features

x86, x86_64avx512
x86, x86_64avx2
x86, x86_64ssse3
x86, x86_64sse2
🚧arm, aarch64neon

MSRV 1.36.0**

Minimum supported rust version is tested before a new version is published. [**] Feature const-generics needs to disabled to build on rustc versions <1.51 which can be done by updating your dependency definition to the following.

CPU Feature Detection

simd-adler32 supports both runtime and compile time CPU feature detection using the std::is_x86_feature_detected macro when the Adler32 struct is instantiated with the new fn.

Without std feature enabled simd-adler32 falls back to compile time feature detection using target-feature or target-cpu flags supplied to rustc. See for more information.

Feature detection tries to use the fastest supported feature first.


pub use hash::*;


BufRead-based hashing.

Reader-based hashing.


A rolling hash generator type.


A Adler-32 hash-able type.


Compute Adler-32 hash on Adler32Hash type.