[][src]Module fasthash::murmur3

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

by Austin Appleby (aappleby (AT) gmail)

https://sites.google.com/site/murmurhash/

Note

The x86 and x64 versions do not produce the same results, as the algorithms are optimized for their respective platforms. You can still compile and run any of them on any platform, but your performance with the non-native version will be less than optimal.

Example

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

use fasthash::{murmur3, Murmur3HasherExt};

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

let h = murmur3::hash128(b"hello world\xff");

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

Structs

Hash32

MurmurHash3 32-bit hash functions

Hash128_x64

MurmurHash3 128-bit hash functions for 64-bit processors

Hash128_x86

MurmurHash3 128-bit hash functions for 32-bit processors

Hasher32

An implementation of std::hash::Hasher.

Hasher128_x64

An implementation of std::hash::Hasher and fasthash::HasherExt.

Hasher128_x86

An implementation of std::hash::Hasher and fasthash::HasherExt.

Functions

hash32

MurmurHash3 32-bit hash functions for a byte array.

hash32_with_seed

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

hash128

MurmurHash3 128-bit hash functions for a byte array.

hash128_with_seed

MurmurHash3 128-bit hash functions for a byte array. For convenience, a 32-bit seed is also hashed into the result.