Module fasthash::murmur3 [] [src]

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, Murmur3Hasher};

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

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

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

Structs

Murmur3Hasher_x64_128

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

Murmur3Hasher_x86_128

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

Murmur3Hasher_x86_32

An implementation of std::hash::Hasher.

Murmur3_x64_128

MurmurHash3 128-bit hash functions for 64-bit processors

Murmur3_x86_128

MurmurHash3 128-bit hash functions for 32-bit processors

Murmur3_x86_32

MurmurHash3 32-bit hash functions

Functions

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.

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.