Skip to main content

rapidhash/v2/
mod.rs

1//! Portable hashing: rapidhash V2.2 algorithm.
2//!
3//! For new code, please use [`crate::v3`] instead, as it is a superior hashing algorithm.
4
5mod rapid_const;
6#[cfg(any(feature = "std", docsrs))]
7mod rapid_file;
8mod seed;
9
10#[doc(inline)]
11pub use rapid_const::*;
12#[doc(inline)]
13#[cfg(any(feature = "std", docsrs))]
14pub use rapid_file::*;
15#[doc(inline)]
16pub use seed::*;
17
18#[cfg(test)]
19mod tests {
20    extern crate std;
21
22    use crate::util::macros::{compare_to_c, flip_bit_trial};
23    use super::*;
24
25    flip_bit_trial!(flip_bit_trial_v2_0, rapidhash_v2_inline::<0, true, false, false>);
26    flip_bit_trial!(flip_bit_trial_v2_1, rapidhash_v2_inline::<1, true, false, false>);
27    flip_bit_trial!(flip_bit_trial_v2_2, rapidhash_v2_inline::<2, true, false, false>);
28    compare_to_c!(compare_to_c_v2_0, rapidhash_v2_inline::<0, true, false, false>, rapidhash_v2_inline::<0, true, true, false>, rapidhashcc_v2);
29    compare_to_c!(compare_to_c_v2_1, rapidhash_v2_inline::<1, true, false, false>, rapidhash_v2_inline::<1, true, true, false>, rapidhashcc_v2_1);
30    compare_to_c!(compare_to_c_v2_2, rapidhash_v2_inline::<2, true, false, false>, rapidhash_v2_inline::<2, true, true, false>, rapidhashcc_v2_2);
31}