Main

Hash Functions

Last updated 27 June 2026

Hash Functions

TODO: remove nutshell

::: note In a Nutshell Put this key into a slot X. :::

A hash function is a deterministic mapping:

h:U[0,m1] h:U \to [0, m-1]

Where:

Universe of Keys

The universe of key is everything we could ever hash. For example

The problem in reality is that the universe is way bigger than the hash table. This means collisions are inevitable. This plays a role in choosing the right hash function.

Choosing the Hash Function

So we want the hash function to at least look random.

TODO hash function families

← Back to Data structures