Module fasthash::lookup3 [] [src]

Lookup3, non-cryptographic hash.

by Bob Jekins

http://burtleburtle.net/bob/c/lookup3.c

Example

use std::hash::{Hash, Hasher};

use fasthash::{lookup3, Lookup3Hasher};

fn hash<T: Hash>(t: &T) -> u64 {
    let mut s: Lookup3Hasher = Default::default();
    t.hash(&mut s);
    s.finish()
}

let h = lookup3::hash32(b"hello world\xff");

assert_eq!(h, hash(&"hello world") as u32);

Structs

Lookup3

Lookup3 32-bit hash functions

Lookup3Hasher

An implementation of std::hash::Hasher.

Functions

hash32

Lookup3 32-bit hash functions for a byte array.

hash32_with_seed

Lookup3 32-bit hash function for a byte array. For convenience, a 32-bit seed is also hashed into the result.