Skip to main content

rapidhash_v3_inline

Function rapidhash_v3_inline 

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

Rapidhash V3 a single byte stream, matching the C++ implementation.

Is marked with #[inline(always)] to force the compiler to inline and optimize the method. Can provide large performance uplifts for fixed-length inputs at compile time.

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.
  • COMPACT: Generates fewer instructions at compile time with less manual loop unrolling, but may be slower on some platforms. Disabled by default.
  • PROTECTED: Slightly stronger hash quality and DoS resistance by performing two extra XOR instructions on every mix step. Disabled by default.