[−][src]Struct tab_hash::Tab32Twisted
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)); } }
Methods
impl Tab32Twisted
[src]
pub fn new() -> Self
[src]
Create a new twisted tabulation hash function with a random table.
pub fn to_vec(&self) -> Vec<Vec<u64>>
[src]
Create a new simple tabulation hash function with a random table.
pub fn from_vec(table_data: Vec<Vec<u64>>) -> Self
[src]
Create a new simple tabulation hash function with a random table.
pub fn with_table(table: [[u64; 256]; 4]) -> Self
[src]
Create a new twisted tabulation hash function with a given table.
pub fn get_table(&self) -> [[u64; 256]; 4]
[src]
Get the table used by this hash function.
pub fn hash(&self, x: u32) -> u32
[src]
Compute twisted tabulation hash value for a 32bit integer number.
Trait Implementations
impl Clone for Tab32Twisted
[src]
fn clone(&self) -> Tab32Twisted
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'de> Deserialize<'de> for Tab32Twisted
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for Tab32Twisted
[src]
Auto Trait Implementations
impl RefUnwindSafe for Tab32Twisted
impl Send for Tab32Twisted
impl Sync for Tab32Twisted
impl Unpin for Tab32Twisted
impl UnwindSafe for Tab32Twisted
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,