pub struct Tab32Twisted { /* private fields */ }Expand description
A universal hash function for 32-bit integers using twisted tabulation.
Usage:
use tab_hash::Tab32Twisted;
fn main() {
let keys = vec![0, 8, 15, 47, 11];
let twisted = Tab32Twisted::new();
for k in keys {
println!("{}", twisted.hash(k));
}
}Implementations§
Source§impl Tab32Twisted
impl Tab32Twisted
Sourcepub fn to_vec(&self) -> Vec<Vec<u64>>
pub fn to_vec(&self) -> Vec<Vec<u64>>
Create a new simple tabulation hash function with a random table.
Sourcepub fn from_vec(table_data: Vec<Vec<u64>>) -> Self
pub fn from_vec(table_data: Vec<Vec<u64>>) -> Self
Create a new simple tabulation hash function with a random table.
Sourcepub fn with_table(table: [[u64; 256]; 4]) -> Self
pub fn with_table(table: [[u64; 256]; 4]) -> Self
Create a new twisted tabulation hash function with a given table.
Trait Implementations§
Source§impl Clone for Tab32Twisted
impl Clone for Tab32Twisted
Source§fn clone(&self) -> Tab32Twisted
fn clone(&self) -> Tab32Twisted
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'de> Deserialize<'de> for Tab32Twisted
impl<'de> Deserialize<'de> for Tab32Twisted
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Tab32Twisted
impl RefUnwindSafe for Tab32Twisted
impl Send for Tab32Twisted
impl Sync for Tab32Twisted
impl Unpin for Tab32Twisted
impl UnwindSafe for Tab32Twisted
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more