Module fasthash::metro
[−]
[src]
MetroHash
, Exceptionally fast and statistically robust hash functions
by J. Andrew Rogers
https://github.com/jandrewrogers/metrohash
MetroHash
is a set of state-of-the-art hash functions for non-cryptographic use cases.
They are notable for being algorithmically generated in addition to their exceptional
performance. The set of published hash functions may be expanded in the future,
having been selected from a very large set of hash functions that have been
constructed this way.
Fastest general-purpose functions for bulk hashing. Fastest general-purpose functions for small, variable length keys. Robust statistical bias profile, similar to the MD5 cryptographic hash. Hashes can be constructed incrementally (new) 64-bit, 128-bit, and 128-bit CRC variants currently available. Optimized for modern x86-64 microarchitectures. Elegant, compact, readable functions.
You can read more about the design and history here.
Example
use std::hash::{Hash, Hasher}; use fasthash::{metro, MetroHasher}; fn hash<T: Hash>(t: &T) -> u64 { let mut s: MetroHasher = Default::default(); t.hash(&mut s); s.finish() } let h = metro::hash64(b"hello world\xff"); assert_eq!(h, hash(&"hello world"));
Structs
MetroHash128Crc_1 |
|
MetroHash128Crc_2 |
|
MetroHash128_1 |
|
MetroHash128_2 |
|
MetroHash64Crc_1 |
|
MetroHash64Crc_2 |
|
MetroHash64_1 |
|
MetroHash64_2 |
|
MetroHasher128Crc_1 |
An implementation of |
MetroHasher128Crc_2 |
An implementation of |
MetroHasher128_1 |
An implementation of |
MetroHasher128_2 |
An implementation of |
MetroHasher64Crc_1 |
An implementation of |
MetroHasher64Crc_2 |
An implementation of |
MetroHasher64_1 |
An implementation of |
MetroHasher64_2 |
An implementation of |
Functions
hash64 |
|
hash128 |
|
hash128_with_seed |
|
hash64_with_seed |
|