A fast portable non-cryptographic 64-bit hash function optimized for modern 64-bit CPUs, often outperforming xxHash and StadtX.
t1ha (Fast Positive Hash) is a portable non-cryptographic 64-bit hash function designed for high performance on modern 64-bit CPUs, particularly x86_64 and Elbrus architectures. It provides fast hashing for use cases like checksums, hash tables, and data fingerprinting, often outperforming other portable hash functions like xxHash and StadtX. The library includes multiple variants optimized for different trade-offs between speed, stability, and quality.
Developers and engineers working on performance-sensitive applications requiring fast hashing for data integrity, hash tables, or fingerprinting, especially those targeting 64-bit systems.
t1ha offers exceptional speed—often 15% faster than comparable portable hash functions—while maintaining good quality and portability across platforms, with hardware acceleration support and a permissive zlib license.
One of the fastest hash functions.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Benchmarks in the README show t1ha is up to 15% faster than comparable portable hash functions like xxHash and StadtX on 64-bit systems, with t1ha0 achieving the highest speeds.
Includes optimized variants like t1ha0_ia32aes_avx2 that leverage AES-NI and AVX/AVX2 extensions on x86 CPUs for peak performance, as detailed in the implementation table.
All variants pass SMHasher tests, and t1ha2 specifically addresses strict avalanche criteria flaws from t1ha1, ensuring good distribution for hash tables and checksums.
Offers t1ha0 for maximum speed (machine-dependent), t1ha1 for portable stability, and t1ha2 for enhanced quality with 128-bit and streaming support, catering to different use cases.
t1ha0's hash results vary by CPU architecture, bitness, and endianness, making it unsuitable for persistent data or cross-system consistency, as warned in the README.
The README admits that wyhash currently outperforms t1ha on x86_64, and while future versions like t1ha3 aim to improve, this is a current limitation for peak speed seekers.
Designed for 64-bit little-endian systems, it runs slowly on 32-bit or big-endian CPUs without native 64-bit operations, as noted in the portability section.