pub struct Tab64Twisted { /* private fields */ }Expand description
A universal hash function for 64-bit integers using twisted tabulation.
Usage:
use tab_hash::Tab64Twisted;
fn main() {
let keys = vec![0, 8, 15, 47, 11];
let twisted = Tab64Twisted::new();
for k in keys {
println!("{}", twisted.hash(k));
}
}Implementations§
Source§impl Tab64Twisted
impl Tab64Twisted
Sourcepub fn to_vec(&self) -> Vec<Vec<u128>>
pub fn to_vec(&self) -> Vec<Vec<u128>>
Create a new simple tabulation hash function with a random table.
Sourcepub fn from_vec(table_data: Vec<Vec<u128>>) -> Self
pub fn from_vec(table_data: Vec<Vec<u128>>) -> Self
Create a new simple tabulation hash function with a random table.
Sourcepub fn with_table(table: [[u128; 256]; 8]) -> Self
pub fn with_table(table: [[u128; 256]; 8]) -> Self
Create a new twisted tabulation hash function with a given table.
Trait Implementations§
Source§impl Clone for Tab64Twisted
impl Clone for Tab64Twisted
Source§fn clone(&self) -> Tab64Twisted
fn clone(&self) -> Tab64Twisted
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 Tab64Twisted
impl<'de> Deserialize<'de> for Tab64Twisted
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 Tab64Twisted
impl RefUnwindSafe for Tab64Twisted
impl Send for Tab64Twisted
impl Sync for Tab64Twisted
impl Unpin for Tab64Twisted
impl UnwindSafe for Tab64Twisted
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