Skip to content
/ t1ha Public
forked from erthink/t1ha

t1ha = Fast Positive Hash, aka "Позитивный Хэш".

License

Notifications You must be signed in to change notification settings

lemenkov/t1ha

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 

Repository files navigation

t1ha

Fast Positive Hash, aka "Позитивный Хэш" by Positive Technologies.

Briefly, it is a 64-bit Hash Function:

  1. Created for 64-bit little-endian platforms, in predominantly for x86_64, but without penalties could runs on any 64-bit CPU.
  2. In most cases up to 15% faster than City64, xxHash, mum-hash, metro-hash and all others which are not use specific hardware tricks.
  3. 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:

  1. 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.
  2. This implementation of t1ha requires modern GNU C compatible compiler, includes Clang/LLVM; or MSVC++ 14.0 (Visual Studio 2015).

Benchmarking and Testing

SMHasher is a wellknown test suite designed to test the distribution, collision, and performance properties of non-cryptographic hash functions.

Reini Urban provides extended version/fork of SMHasher which integrates a lot of modern hash functions, including t1ha.

So, the quality and speed of t1ha can be easily checked with the following scenario:

git clone https://github.com/rurban/smhasher
cd smhasher
cmake .
make
./SMHasher City64
./SMHasher metrohash64_1
./SMHasher xxHash64
./SMHasher mum
...
./SMHasher t1ha

For properly performance please use at least GCC 5.4 or Clang 3.8.

About

t1ha = Fast Positive Hash, aka "Позитивный Хэш".

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 100.0%