Maintainers
Pricing
Enterprise
More
More
Documentation
Try Live
Rankings
Install
Blog
Docs7
Ask
New
Add Docs
Fast Hash
https://github.com/ztanml/fast-hash
Admin
Fast Hash is a simple, robust, and efficient general-purpose hash function designed for
...
Tokens:
4,578
Snippets:
16
Trust Score:
5.9
Update:
1 week ago
Context
Chat
Benchmark
Latest
Show doc for...
Code
Info
Show Results
Tokens:
Raw
Copy
Link
Tokens:
Raw
Copy
Link
### MurmurHash2 mix function Source: https://github.com/ztanml/fast-hash/blob/master/README.md MurmurHash2's mix function, which has two multiplications and one Xorshift. It is slightly flawed as it produces biased bits according to the SMHasher results. ```c #define mix_murmur2(h) ({ \ (h) *= 0xc6a4a7935bd1e995ULL; \ (h) ^= (h) >> 47; \ (h) *= 0xc6a4a7935bd1e995ULL; }) ``` -------------------------------- ### fast-hash mix function Source: https://github.com/ztanml/fast-hash/blob/master/README.md The mix function of the fast-hash algorithm, consisting of two Xorshifts and one multiplication. It is more efficient than MurmurHash2's mix function because multiplication is more expensive than Xorshift on most platforms. ```c #define mix_fasthash(h) ({ \ (h) ^= (h) >> 23; \ (h) *= 0x2127599bf4325c37ULL; \ (h) ^= (h) >> 47; }) ```