Skip to main content

rapidhash_v3_micro_inline

Function rapidhash_v3_micro_inline 

Source
pub const fn rapidhash_v3_micro_inline<const AVALANCHE: bool, const PROTECTED: bool>(
    data: &[u8],
    seed: &RapidSecrets,
) -> u64
Expand description

Rapidhash V3 Micro, a very compact version of the rapidhash algorithm.

WARNING: This produces a different output from rapidhash_v3.

Designed for HPC and server applications, where cache misses make a noticeable performance detriment. Compiles it to ~140 instructions without stack usage, both on x86-64 and aarch64. Faster for sizes up to 512 bytes, just 15%-20% slower for inputs above 1kb.

Compile time arguments:

  • AVALANCHE: Perform an extra mix step to avalanche the bits for higher hash quality. Enabled by default to match the C++ implementation.
  • PROTECTED: Slightly stronger hash quality and DoS resistance by performing two extra XOR instructions on every mix step. Disabled by default.