Skip to content

Questions about Hash function

Short answers, pulled from the story.

What is a hash function and how does it map data?

A hash function takes data of arbitrary size and maps it to fixed-size values. These returned values are called hash codes, digests, or simply hashes. The primary role is to index a fixed-size table known as a hash table.

When did Hans Peter Luhn first use the concept of a hash function?

Hans Peter Luhn of IBM appears to have been the first to use the concept of a hash function in a memo dated January 1953. The term itself did not appear in published literature until the late 1960s in Herbert Hellerman's Digital Computer System Principles.

How do cryptographic hash functions differ from standard hashing methods?

Standard hashing prioritizes computational speed over security features like integrity checking. Cryptographic hash functions differ by securing sensitive data such as passwords on servers. Integrity checking ensures identical files produce matching values to detect modifications.

Which specific techniques does Fibonacci hashing employ for uniform distribution?

Fibonacci hashing uses the golden ratio approximately 1.618 as a multiplier for uniform distribution. Division-based implementations use modulo functions selecting prime divisors close to table size. Multiplicative hashing employs formulas involving multipliers that are relatively prime to the modulus.

What happens when multiple keys map to the same index in a hash table?

When multiple keys map to the same index, collision resolution becomes necessary. Chained hashing places each slot at the head of a linked list where colliding items form a chain. Open address hashing probes the table starting from an occupied slot until an empty one appears.