Skip to main content

Module wyhash

Module wyhash 

Source
Expand description

wyhash, the shard’s key hash.

Written here rather than pulled in. aki measured wyhash at 1.95 ns against fnv1a’s 5.39 ns on the same keys (L13), and the whole index probe budget is 4 ns, so the hash is not a place to accept a dependency’s version churn.

This is wyhash final version 3 with the default secret, which is the variant every other implementation calls wyhash today. The test vectors at the bottom are the reference vectors from the C implementation, so a change that alters a hash value fails the build rather than silently repartitioning every existing .yo file.

Functions§

hash_key
Hash with the shard’s seed.
tag_of
The 8 high bits of a hash, as the index bucket stores them.
wyhash
Hash key with seed.