encyclopegia.org

Jenkins hash function

The Jenkins hash functions are a family of non-cryptographic hash functions for multi-byte keys designed by Bob Jenkins.[src] The first one was formally published in 1997.[src]

The Jenkins hash functions are a family of non-cryptographic hash functions for multi-byte keys designed by Bob Jenkins.[src] The first one was formally published in 1997.[src] ==The hash functions== ===one_at_a_time=== Jenkins's one_at_a_time (joaat) hash is adapted here from a WWW page by Bob Jenkins, which is an expanded version of his Dr.[src] Dobb's article.[src] It was originally created to fulfill certain requirements described by Colin Plumb, a cryptographer.[src] Rockstar Games' RAGE engine makes extensive use of this hashing function.[src] uint32_t jenkins_one_at_a_time_hash(const uint8_t* key, size_t length) { size_t i = 0; uint32_t hash = 0; while (i != length) { hash += key[i++]; hash += hash > 6; } hash += hash > 11; hash += hash Sample hash values for one_at_a_time hash function.[src] one_at_a_time("a", 1) 0xca2e9442 one_at_a_time("The quick brown fox jumps over the lazy dog", 43) 0x519e91f5 The avalanche behavior of this hash is shown on the right.[src] Each of the 24 rows corresponds to a single bit in the 3-byte input key, and each of the 32 columns corresponds to a bit in the output hash.[src] Colors are chosen by how well the input key bit affects the given output hash bit: a green square indicates good mixing behavior, a yellow square weak mixing behavior, and red would indicate no mixing.[src] Only a few bits in the last byte of the input key are weakly mixed to a minority of bits in the output hash.[src] Standard implementations of the Perl programming language prior to version 5.28 included Jenkins's one-at-a-time hash or a hardened variant of it, which was used by default.[src] ===lookup2=== The lookup2 function was an interim successor to one-at-a-time.[src] It is the function referred to as "My Hash" in the 1997 Dr.[src] Dobbs journal article, though it has been obsoleted by subsequent functions that Jenkins has released.[src] Applications of this hash function are found in: the SPIN model checker, for probabilistic error detection.[src] In a paper about this program, researchers Dillinger and Manolios note that lookup2 is "a popular choice among implementers of hash tables and Bloom filters".[src] They study lookup2 and a simple extension of it that produces 96-bit rather than 32-bit hash values.[src] The Netfilter firewall component of Linux, where it replaced an earlier hash function that was too sensitive to collisions.[src] The resulting system, however, was shown to still be sensitive to hash flooding attacks, even when the Jenkins hash is randomized using a secret key.[src] The program that solved the game of kalah used the Jenkins hash function, instead of the Zobrist hashing technique more commonly used for this type of problem; the reasons for this choice were the speed of Jenkins' function on the small representations of kalah boards, as well as the fact that the basic rule of kalah can radically alter the board, negating the benefit of Zobrist's incremental computation of hash functions.[src] ===lookup3=== The lookup3 function consumes input in 12 byte (96 bit) chunks.[src] It may be appropriate when speed is more important than simplicity.[src] Note, though, that any speed improvement from the use of this hash is only likely to be useful for large keys, and that the increased complexity may also have speed consequences such as preventing an optimizing compiler from inlining the hash function.[src] The lookup3 function was incorporated into Hierarchical Data Format 5 as a checksum for internal data structures based on its relative strength and speed in comparison to CRC-32 and Fletcher-32.[src] ===SpookyHash=== In 2011 Jenkins released a new 128-bit hash function called SpookyHash.[src] SpookyHash is significantly faster than lookup3.[src] Example for V2 (little-endian x64): The short method for less than 192 bytes (43 bytes): Hash128("The quick brown fox jumps over the lazy dog") 2b12e846aa0693c71d367e742407341b The standard method for more than 191 bytes (219 bytes): Hash128("The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog") f1b71c6ac5af39e7b69363a60dd29c49 ==See also== Non-cryptographic hash functions ==References==[src]

30 sentences · 30 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Jenkins hash function." encyclopegia.org, 2026, https://encyclopegia.org/wiki/jenkins-hash-function. Accessed 26 November 2026.

Chicago

"Jenkins hash function." encyclopegia.org. Accessed November 26, 2026. https://encyclopegia.org/wiki/jenkins-hash-function.

APA

encyclopegia.org. (2026). Jenkins hash function. Retrieved November 26, 2026, from https://encyclopegia.org/wiki/jenkins-hash-function

Accessed November 26, 2026 · CC BY-SA 4.0 · citation page · JSON

Claims

PredicateValueSource
publication date1997Wikipedia

Related articles

Hash Chain

article · references available

War of Jenkins' Ear

stub · references available

graph of a function

stub · references available

monotonic function

stub · references available

zero of a function

stub · references available

function composition

stub · references available

Ferguson Jenkins

stub · references available
CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1358275216 · 0.5 · snapshot enwiki-001358275216

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.