Hash Code

noun

say it: “HASH KOHD” /hæʃ koʊd/

The whole number a hash function gives for a key, before a hash table keeps its remainder to pick a bucket.

What is a hash code?

A hash code is the number a hash function gives for a key. A hash table divides it by its number of buckets and keeps the remainder to pick one. Two equal keys must always have the same hash code, or a lookup goes to the wrong bucket.

In a sentence

  • “Two equal member cards gave different hash codes, so the dictionary looked for the second one in the wrong bucket.”

Level: Journeyman · More Data Structures terms at this level

Updated