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