Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. C
  3. t1ha

t1ha

NOASSERTIONC

A fast portable non-cryptographic 64-bit hash function optimized for modern 64-bit CPUs, often outperforming xxHash and StadtX.

GitHubGitHub
367 stars31 forks0 contributors

What is t1ha?

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.

Target Audience

Developers and engineers working on performance-sensitive applications requiring fast hashing for data integrity, hash tables, or fingerprinting, especially those targeting 64-bit systems.

Value Proposition

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.

Overview

One of the fastest hash functions.

Use Cases

Best For

  • Implementing high-performance hash tables in C/C++ applications
  • Generating fast checksums for large datasets or network packets
  • Creating lightweight data fingerprints for caching or deduplication
  • Optimizing hashing in embedded or edge computing on 64-bit CPUs
  • Benchmarking and comparing hash function performance
  • Replacing slower non-cryptographic hashes like xxHash in performance-critical code

Not Ideal For

  • Applications requiring identical hash outputs across different CPU architectures or software versions, such as distributed databases or file systems with persistent hashes
  • Projects targeting 32-bit or big-endian systems where performance degrades significantly due to lack of native 64-bit arithmetic support
  • Cryptographic use cases like password hashing or digital signatures, as t1ha is explicitly non-cryptographic and lacks security guarantees
  • Teams needing a simple, drop-in hash function without managing multiple variants or compiler dependencies

Pros & Cons

Pros

Blazing Fast Performance

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.

Hardware Acceleration Support

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.

Quality and Rigorous Testing

All variants pass SMHasher tests, and t1ha2 specifically addresses strict avalanche criteria flaws from t1ha1, ensuring good distribution for hash tables and checksums.

Flexible Variant Choices

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.

Cons

Platform-Dependent Outputs

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.

Outpaced by wyhash on x86_64

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.

Poor Performance on Non-Target Platforms

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.

Frequently Asked Questions

Quick Stats

Stars367
Forks31
Contributors0
Open Issues0
Last commit1 year ago
CreatedSince 2016

Tags

#c-library#hash-tables#hashing#simd#portable#non-cryptographic#checksum#64-bit#fingerprinting#hash-functions#hash-function#performance

Built With

A
AVX
S
SIMD
A
AVX2
C
C++

Included in

C3.8k
Auto-fetched 1 hour ago

Related Projects

murmurmurmur

Intel® Implicit SPMD Program Compiler

Stars2,914
Forks346
Last commit5 days ago
libcrclibcrc

Murmur3 hash in C

Stars444
Forks90
Last commit3 years ago
jwHashjwHash

Simple hash table implementation for C.

Stars220
Forks25
Last commit5 years ago
xxHashxxHash

Extremely fast non-cryptographic hash algorithm. 2-clause BSD

Stars0
Forks0
Last commit
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub