The history of hashing begins in the 1950s, when computers were increasingly being used to manage growing volumes of business and scientific information. Employee records, customer details, inventories and experimental data all had to be stored and retrieved efficiently. At the time, much of this information was kept on sequential-access media such as punched cards and magnetic tapes. Finding a particular record meant scanning through the collection one item at a time, a process that became increasingly expensive as the amount of data grew.
Random-access storage offered a better, though more expensive, alternative. Magnetic disks, for example, allowed computers to access specific storage locations directly. However, the problem of translating the identifying key of a record into its storage address remained. One solution was an index: a separate lookup structure mapping keys to addresses.
In 1953, IBM researcher Hans Peter Luhn proposed calculating a storage address directly from a record’s key. Rather than searching an index, a program could apply a mathematical function to an identifying value and use the result to determine where the corresponding record should be stored. This became the fundamental idea behind a hash function.
The approach provided the foundation for the hash table, a data structure that organizes records into a collection of storage positions, typically represented by an array. A hash function transforms each record’s key into an index identifying the position where the record should be stored. To retrieve a record, a program applies the same function to its key and uses the resulting index to locate it directly, without having to examine every entry.
Pragmatic Aspects of Hashing
The concept was developed further by Arnold I. Dumey in a 1956 paper generally recognized as a canonical description of hash coding. Dumey explored different ways of converting alphanumeric keys into numerical addresses. One approach selected particular characters from a key; another treated the key as a number in base 37, using 26 letters, 10 digits and a space. He also described the modulo method, in which a numerical key is divided by the size of the hash table and the remainder determines the position at which the record should be stored. Dumey recommended using a prime number slightly smaller than the number of available table positions.
A practical difficulty soon became apparent: different keys could produce the same hash value and therefore point to the same table position. These events, known as collisions, could not be eliminated altogether because the number of possible keys was usually much larger than the number of available positions. Two major approaches emerged to handle them. Separate chaining associated each table position with a collection of records sharing the same hash value. Open addressing, by contrast, stored colliding records in other available positions within the table. Techniques such as linear probing, quadratic probing and double hashing provided different ways of finding those alternative positions.
Another challenge was table growth. Early implementations often required programmers to choose the table’s capacity in advance. As hash tables became more general-purpose, automatic resizing and rehashing became important: when a table grew too full, a larger one could be allocated and existing records redistributed. In 1980, Litwin introduced linear hashing, a technique originally designed for disk-based files that allowed storage to grow gradually by splitting buckets rather than reorganizing the entire file at once.
Hashing in Software Applications
By the 1970s and 1980s, hash tables had become established in-memory data structures, particularly useful for implementing symbol tables in compilers. They were also increasingly available in programming environments. Languages such as Lisp and Smalltalk provided dictionary or hash-table facilities, while programmers using C, Pascal and FORTRAN often built their own implementations from arrays, records and other basic structures.
Over time, hash tables evolved from relatively simple, manually implemented structures into sophisticated, standard components of programming languages and their libraries. Modern implementations retain the original principles but automate many of the details, including collision resolution, memory allocation and resizing. For example, Java’s HashMap uses separate chaining to handle collisions, with heavily populated buckets potentially converted into balanced trees to improve lookup performance. C#’s Dictionary<TKey, TValue> also uses chaining, but stores entries in a separate array and links colliding entries through indexes. Python’s dict, by contrast, uses open addressing and a compact internal representation that also preserves insertion order.
Modern implementations also allow programmers to define how their own objects are hashed and compared, making it possible to use complex objects as keys. Automatic resizing ensures that the table can grow as new entries are added, while improvements to hash functions and collision handling help maintain efficient access even as collections become larger. Although implementation details differ between languages, the fundamental principles remain those established in the early days of hashing.
Summary
Today, hash tables are among the most widely used data structures in software development. They support everything from caching and indexing to counting occurrences, managing configuration data and representing relationships between keys and values. What began as a practical solution to the problem of locating records in large collections has become a fundamental building block of modern computing.
Yet this is only part of the story of hashing. In the decades since Luhn’s original idea, hashing has expanded far beyond efficient data retrieval to play an important role in cryptography, data integrity and password storage. Another particularly interesting development is the use of Merkle trees, which rely on hash functions to organize and verify large amounts of data. They are fundamental to technologies such as Git and Blockchain systems.
But this is good fodder for another article!