Module fasthash::t1ha
[−]
[src]
Fast Positive Hash, aka "Позитивный Хэш"
by Positive Technologies.
https://github.com/leo-yuriev/t1ha
Briefly, it is a 64-bit Hash Function:
Created for 64-bit little-endian platforms, in predominantly for x86_64
,
but without penalties could runs on any 64-bit CPU.
In most cases up to 15% faster than City64, xxHash, mum-hash,
metro-hash and all others which are not use specific hardware tricks.
Not suitable for cryptography.
Please see t1ha.c for implementation details.
Acknowledgement:
The t1ha was originally developed by Leonid Yuriev (Леонид Юрьев) for The 1Hippeus project - zerocopy messaging in the spirit of Sparta!
Requirements and Portability:
t1ha designed for modern 64-bit architectures. But on the other hand, t1ha doesn't uses any one tricks nor instructions specific to any particular architecture: therefore t1ha could be used on any CPU for which GCC provides support 64-bit arithmetics. but unfortunately t1ha could be dramatically slowly on architectures without native 64-bit operations. This implementation of t1ha requires modern GNU C compatible compiler, includes Clang/LLVM; or MSVC++ 14.0 (Visual Studio 2015).
Example
use std::hash::{Hash, Hasher}; use fasthash::{t1ha, T1haHasher}; fn hash<T: Hash>(t: &T) -> u64 { let mut s: T1haHasher = Default::default(); t.hash(&mut s); s.finish() } let h = t1ha::hash64(b"hello world\xff"); assert_eq!(h, hash(&"hello world"));
Structs
T1ha32Be |
|
T1ha32BeHasher |
An implementation of |
T1ha32Le |
|
T1ha32LeHasher |
An implementation of |
T1ha64Be |
|
T1ha64BeHasher |
An implementation of |
T1ha64Crc |
|
T1ha64CrcHasher |
An implementation of |
T1ha64Le |
|
T1ha64LeHasher |
An implementation of |
Functions
hash32 |
|
hash64 |
|
hash32_with_seed |
|
hash64_with_seed |
|