[][src]Struct tab_hash::Tab64Twisted

pub struct Tab64Twisted { /* fields omitted */ }

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));
    }
}

Methods

impl Tab64Twisted[src]

pub fn new() -> Self[src]

Create a new twisted tabulation hash function with a random table.

pub fn to_vec(&self) -> Vec<Vec<u128>>[src]

Create a new simple tabulation hash function with a random table.

pub fn from_vec(table_data: Vec<Vec<u128>>) -> Self[src]

Create a new simple tabulation hash function with a random table.

pub fn with_table(table: [[u128; 256]; 8]) -> Self[src]

Create a new twisted tabulation hash function with a given table.

pub fn get_table(&self) -> [[u128; 256]; 8][src]

Get the table used by this hash function.

pub fn hash(&self, x: u64) -> u64[src]

Compute twisted tabulation hash value for a 64bit integer number.

Trait Implementations

impl Clone for Tab64Twisted[src]

impl<'de> Deserialize<'de> for Tab64Twisted[src]

impl Serialize for Tab64Twisted[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,