Crate fasthash [] [src]

[]

A suite of non-cryptographic hash functions for Rust.

Example

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

use fasthash::{metro, MetroHasher};

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

let h = metro::hash64(b"hello world\xff");

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

Reexports

pub use city::{CityHasher64 as CityHasher, CityHasher128 as CityHasherExt};
pub use farm::{FarmHasher64 as FarmHasher, FarmHasher128 as FarmHasherExt};
pub use metro::{MetroHasher64_1 as MetroHasher, MetroHasher128_1 as MetroHasherExt};
pub use mum::MumHasher;
pub use murmur::MurmurHasher;
pub use murmur2::Murmur2Hasher_x64_64 as Murmur2Hasher;
pub use murmur3::{Murmur3Hasher_x64_128 as Murmur3Hasher, Murmur3Hasher_x64_128 as Murmur3HasherExt};
pub use spooky::{SpookyHasher64 as SpookyHasher, SpookyHasher128 as SpookyHasherExt};
pub use t1ha::T1ha64LeHasher as T1haHasher;
pub use xx::XXHasher64 as XXHasher;

Modules

city

CityHash, a family of hash functions for strings.

farm

FarmHash, a family of hash functions.

metro

MetroHash, Exceptionally fast and statistically robust hash functions

mum

MUM Hash, Hashing functions and PRNGs based on them

murmur

Murmur, a suite of non-cryptographic hash functions that was used for hash-based lookups.

murmur2

Murmur, a suite of non-cryptographic hash functions that was used for hash-based lookups.

murmur3

Murmur, a suite of non-cryptographic hash functions that was used for hash-based lookups.

spooky

SpookyHash: a 128-bit noncryptographic hash function

t1ha

Fast Positive Hash, aka "Позитивный Хэш"

xx

xxHash - Extremely fast hash algorithm

Traits

FastHash

Fast non-cryptographic hash functions

Fingerprint

Generate a good, portable, forever-fixed hash value

HasherExt

A trait which represents the ability to hash an arbitrary stream of bytes.