[][src]Struct tab_hash::Tab32Simple

pub struct Tab32Simple { /* fields omitted */ }

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

Methods

impl Tab32Simple[src]

pub fn new() -> Self[src]

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

pub fn with_table(table: [[u32; 256]; 4]) -> Self[src]

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

pub fn get_table(&self) -> [[u32; 256]; 4][src]

Get the table used by this hash function.

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

Compute simple tabulation hash value for a 32bit integer number.

Auto Trait Implementations

impl Send for Tab32Simple

impl Sync for Tab32Simple

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.