Hash Lab

Non-cryptographic

Jenkins hash

A family of fast non-cryptographic hash functions designed by Bob Jenkins between 1997 and 2011. Predates MurmurHash and CityHash; its descendants are still in Perl, the Linux kernel, and many C libraries. The defining feature is excellent bit distribution from a small, byte-loop construction.

The three generations

At a glance

Output32 bits (one-at-a-time, lookup3-32), 64-bit (lookup3-64), 128 (Spooky)
DesignerBob Jenkins
Throughput1-3 GiB/s (lookup3), 5-10 GiB/s (Spooky)
StatusNon-cryptographic; vulnerable to hash flooding without seed

Where it shows up

vs MurmurHash3 vs xxHash3

Hash-flooding caveat

Jenkins is not keyed. Hash tables exposed to attacker-chosen keys need to switch to SipHash or use a randomized seed.

References

Quick quiz

Test yourself on jenkins

10 multiple-choice questions. Pick an answer for each, then submit to see explanations.

  1. Q1.Who designed the Jenkins hash family?

  2. Q2.Which Jenkins variant is one-byte-at-a-time?

  3. Q3.Which Linux kernel function descends from Jenkins lookup3?

  4. Q4.Output size of SpookyHash?

  5. Q5.Is Jenkins cryptographic?

  6. Q6.Which language historically used a Jenkins hash for its dict?

  7. Q7.lookup3 vs one-at-a-time main improvement:

  8. Q8.Year SpookyHash was released:

  9. Q9.vs xxHash3 on modern CPUs Jenkins lookup3:

  10. Q10.What's the canonical Jenkins documentation page?

0 of 10 answered