opthash 0.2.0

Rust implementations of Elastic Hashing and Funnel Hashing
Documentation
pub(crate) mod config;
pub(crate) mod control;
pub(crate) mod layout;
pub(crate) mod math;

#[cfg(test)]
mod tests {
    use super::control::ControlOps;
    use super::layout::RawTable;

    #[test]
    fn group_masks_work_on_full_groups() {
        let mut table: RawTable<u64> = RawTable::new(32);
        table.set_control(16, 11);
        assert_eq!(table.group_match_mask(1, 11), 0b1);
        assert!(table.group_free_mask(1) != 0);
    }

    #[test]
    fn fingerprint_summary_bit_matches_fingerprint_domain() {
        let fp = ControlOps::control_fingerprint(0xDEAD_BEEF);
        let bit = ControlOps::fingerprint_bit(fp);
        assert_ne!(bit, 0);
    }
}