Skip to main content

rapidhash_v3_nano_inline

Function rapidhash_v3_nano_inline 

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

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

WARNING: This produces a different output from rapidhash_v3.

Designed for Mobile and embedded applications, where keeping a small code size is a top priority. This should compile it to less than 100 instructions with minimal stack usage, both on x86-64 and aarch64. The fastest for sizes up to 48 bytes, but may be considerably slower for larger inputs.

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.