Skip to content

gzm55/hash-garage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

Collect interesting hashes

NMHASH32/NMHASH32X

32bit hash, the core loop is constructed of invertible operations, and the multiplications are limited to 16x16->16. For better speed on short keys, the limitation is loosen to 32x32->32 multiplication in the NMHASH32X variant when hashing the short keys or avalanching the final result of the core loop.

integer bijections in NMHASH32/NMHASH32X

except common operations, some compound ones are used:

x ^= x << a | x << b; // a != b
x ^= x >> a | x >> b; // a != b
x ^= x << a | x >> b; // a != b && a + b != 32 && a % b != 0 && b % a != 0

// dot_prod_16
x = ((x >> 16) * M1) << 16 | (x * M2 & 0xFFFF); // M1, M2 are odd

Quality

Both hashes are the same high quality, and pass the checking:

Speed

For large keys, the hash is optmized for SSE2/AVX2/AVX512, and archive about 60% speed of XXH3 in Gb/s. For short keys, NMHASH32X is a little faster than xxhash32.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages