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