encyclopegia.org

Pearson hashing

Pearson hashing is a non-cryptographic hash function designed for fast execution on processors with 8-bit registers.[src] Given an input consisting of any number of bytes, it produces as output a single byte that is strongly dependent on every byte of the input.[src] Its implementation requires only a few instructions, plus a 256-byte lookup table containing a permutation of the values 0 through 255.[src] This hash function is a CBC-MAC that uses an 8-bit substitution cipher implemented via the substitution table.[src] An 8-bit cipher has negligible cryptographic security, so the Pearson hash function is not cryptographically strong, but it is useful for implementing hash tables or as a data integrity check code, for which purposes it offers these benefits: * It is extremely simple.[src] * It executes quickly on resource-limited processors.[src] * There is no simple class of inputs for which collisions (identical outputs) are especially likely.[src] * Given a small, privileged set of inputs (e.g., reserved words for a compiler), the permutation table can be adjusted so that those inputs yield distinct hash values, producing what is called a perfect hash function.[src] * Two input strings differing by exactly one character never collide.[src] E.g., applying the algorithm on the strings ABC and AEC will never produce the same value.…[src]

Pearson hashing is a non-cryptographic hash function designed for fast execution on processors with 8-bit registers.[src] Given an input consisting of any number of bytes, it produces as output a single byte that is strongly dependent on every byte of the input.[src] Its implementation requires only a few instructions, plus a 256-byte lookup table containing a permutation of the values 0 through 255.[src] This hash function is a CBC-MAC that uses an 8-bit substitution cipher implemented via the substitution table.[src] An 8-bit cipher has negligible cryptographic security, so the Pearson hash function is not cryptographically strong, but it is useful for implementing hash tables or as a data integrity check code, for which purposes it offers these benefits: It is extremely simple.[src] It executes quickly on resource-limited processors.[src] There is no simple class of inputs for which collisions (identical outputs) are especially likely.[src] Given a small, privileged set of inputs (e.g., reserved words for a compiler), the permutation table can be adjusted so that those inputs yield distinct hash values, producing what is called a perfect hash function.[src] Two input strings differing by exactly one character never collide.[src] E.g., applying the algorithm on the strings ABC and AEC will never produce the same value.[src] One of its drawbacks when compared with other hashing algorithms designed for 8-bit processors is the suggested 256 byte lookup table, which can be prohibitively large for a small microcontroller with a program memory size on the order of hundreds of bytes.[src] A workaround to this is to use a simple permutation function instead of a table stored in program memory.[src] However, using a too simple function, such as T[i] = 255-i , partly defeats the usability as a hash function as anagrams will result in the same hash value; using a too complex function, on the other hand, will affect speed negatively.[src] Using a function rather than a table also allows extending the block size.[src] Such functions naturally have to be bijective, like their table variants.[src] The algorithm can be described by the following pseudocode, which computes the hash of message C using the permutation table T: algorithm pearson hashing is h := 0 for each c in C loop h := T[ h xor c ] end loop return h The hash variable ( ) may be initialized differently, e.g.[src] to the length of the data ( ) modulo 256.[src] public class PearsonHashing { public static byte Hash(string input) { byte[] T = { /* Permutation of 0-255 */ }; byte hash = 0; byte[] bytes = Encoding.UTF8.GetBytes(input); foreach (byte b in bytes) { hash = T[hash ^ b]; } return hash; } } ==See also== Non-cryptographic hash functions[src]

28 sentences · 28 cited inline · 0 references stored

References

No reference rows published for this article.

Cite this article

MLA

"Pearson hashing." encyclopegia.org, 2025, https://encyclopegia.org/wiki/pearson-hashing. Accessed 27 November 2026.

Chicago

"Pearson hashing." encyclopegia.org. Accessed November 27, 2026. https://encyclopegia.org/wiki/pearson-hashing.

APA

encyclopegia.org. (2025). Pearson hashing. Retrieved November 27, 2026, from https://encyclopegia.org/wiki/pearson-hashing

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

Related articles

Pearson VUE

stub · references available

universal hashing

stub · references available

Ewan Pearson

stub · references available

Stan Pearson

stub · references available

Locality-sensitive hashing

stub · references available

Pearson & Cox

stub · references available

Oliver Payne Pearson

stub · references available

Pearson

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

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
  • Careers — open roles: frontier engineers and sales partners

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