IterHashes

Trait IterHashes 

Source
pub trait IterHashes<Word, const PERMUTATIONS: usize>
where Word: Min + XorShift + Copy + Eq, u64: Primitive<Word>,
{ // Provided methods fn iter_hashes_from_value<H: Hash, HS: Hasher>( value: H, hasher: HS, ) -> impl Iterator<Item = Word> { ... } fn iter_siphashes13_from_value<H: Hash>( value: H, ) -> impl Iterator<Item = Word> { ... } fn iter_keyed_siphashes13_from_value<H: Hash>( value: H, key0: u64, key1: u64, ) -> impl Iterator<Item = Word> { ... } fn iter_fvn_from_value<H: Hash>(value: H) -> impl Iterator<Item = Word> { ... } fn iter_keyed_fvn_from_value<H: Hash>( value: H, key: u64, ) -> impl Iterator<Item = Word> { ... } }

Provided Methods§

Source

fn iter_hashes_from_value<H: Hash, HS: Hasher>( value: H, hasher: HS, ) -> impl Iterator<Item = Word>

Iterate on the hashes from the provided value and hasher.

§Arguments
  • value - The value to hash.
Source

fn iter_siphashes13_from_value<H: Hash>(value: H) -> impl Iterator<Item = Word>

Iterate on the SipHasher13 hashes from the provided value.

§Arguments
  • value - The value to hash.
§Examples
use minhash_rs::prelude::*;

let mut minhash = MinHash::<u64, 128>::new();

assert!(!minhash.may_contain_value_with_siphashes13(42));
minhash.insert_with_siphashes13(42);
assert!(minhash.may_contain_value_with_siphashes13(42));
minhash.insert_with_siphashes13(47);
assert!(minhash.may_contain_value_with_siphashes13(47));
Source

fn iter_keyed_siphashes13_from_value<H: Hash>( value: H, key0: u64, key1: u64, ) -> impl Iterator<Item = Word>

Iterate on the keyed SipHasher13 hashes from the provided value.

§Arguments
  • value - The value to hash.
  • key0 - The first key.
  • key1 - The second key.
§Examples
use minhash_rs::prelude::*;

let mut minhash = MinHash::<u64, 128>::new();
let key0 = 0x0123456789ABCDEF;
let key1 = 0xFEDCBA9876543210;

assert!(!minhash.may_contain_value_with_keyed_siphashes13(42, key0, key1));
minhash.insert_with_keyed_siphashes13(42, key0, key1);
assert!(minhash.may_contain_value_with_keyed_siphashes13(42, key0, key1));
minhash.insert_with_keyed_siphashes13(47, key0, key1);
assert!(minhash.may_contain_value_with_keyed_siphashes13(47, key0, key1));
Source

fn iter_fvn_from_value<H: Hash>(value: H) -> impl Iterator<Item = Word>

Iterate on the FVN hashes from the provided value.

§Arguments
  • value - The value to hash.
§Examples
use minhash_rs::prelude::*;

let mut minhash = MinHash::<u64, 128>::new();

assert!(!minhash.may_contain_value_with_fvn(42));
minhash.insert_with_fvn(42);
assert!(minhash.may_contain_value_with_fvn(42));
minhash.insert_with_fvn(47);
assert!(minhash.may_contain_value_with_fvn(47));
Source

fn iter_keyed_fvn_from_value<H: Hash>( value: H, key: u64, ) -> impl Iterator<Item = Word>

Iterate on the keyed SipHasher13 hashes from the provided value.

§Arguments
  • value - The value to hash.
  • key - The first key.
§Examples
use minhash_rs::prelude::*;

let mut minhash = MinHash::<u64, 128>::new();
let key = 0x0123456789ABCDEF;

assert!(!minhash.may_contain_value_with_keyed_fvn(42, key));

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Word: Min + XorShift + Copy + Eq, const PERMUTATIONS: usize> IterHashes<Word, PERMUTATIONS> for MinHash<Word, PERMUTATIONS>
where u64: Primitive<Word>,