AI Dictionary › Fondamenti AI

Hashing

Hashing is the process of transforming data of any size into a fixed-length string, called a hash or digest, through a deterministic mathematical function. The same input always yields the same hash, while different inputs almost always yield different hashes. It is the building block behind ultra-fast lookup tables, integrity checks and digital signatures.

Definition

What it is

Hashing is the process of transforming data of any size into a fixed-length string, called a hash or digest, through a deterministic mathematical function. The same input always yields the same hash, while different inputs almost always yield different hashes. It is the building block behind ultra-fast lookup tables, integrity checks and digital signatures.

How it works

A hash function scrambles the input's bits through arithmetic and logical operations until it produces a compact, seemingly random value. In hash tables that value becomes the address where the data is stored, enabling lookups in near-constant time. When two inputs produce the same hash, it is called a collision: cryptographic functions such as SHA-256 are designed to make collisions practically impossible to find.

Applications

In AI, hashing deduplicates training datasets, generates cache keys for prompts and responses, detects duplicate content, and powers approximate indexes for similar-vector search (locality-sensitive hashing). Beyond AI, it verifies download integrity, protects passwords in databases and underpins blockchains.

History & etymology

The foundations trace back to Hans Peter Luhn, an IBM researcher who in 1953 described in an internal memorandum the idea of placing data according to a code derived from its content. The origin of the name is uncertain: the most credible hypothesis links it to the culinary sense of hash, to chop and mix, because the function minces the input and shuffles the pieces. The term became standard in computer science literature during the 1960s.

Definizione (italiano)

L'hashing è il processo che trasforma un dato di qualunque dimensione in una stringa di lunghezza fissa, detta hash o digest, tramite una funzione matematica deterministica. Lo stesso input produce sempre lo stesso hash, mentre input diversi producono quasi sempre hash diversi. È il mattone su cui poggiano tabelle di ricerca velocissime, verifiche di integrità e firme digitali.

Una funzione di hash mescola i bit dell'input attraverso operazioni aritmetiche e logiche fino a ottenere un valore compatto e apparentemente casuale. Nelle hash table questo valore diventa l'indirizzo dove salvare il dato, permettendo ricerche in tempo pressoché costante. Quando due input producono lo stesso hash si parla di collisione: le funzioni crittografiche come SHA-256 sono progettate per rendere le collisioni praticamente impossibili da trovare.

Nell'AI l'hashing serve a deduplicare i dataset di addestramento, a generare chiavi di cache per prompt e risposte, a rilevare contenuti duplicati e a costruire indici approssimati per la ricerca di vettori simili (locality-sensitive hashing). Fuori dall'AI garantisce l'integrità dei download, protegge le password nei database e alimenta le blockchain.

Le fondamenta risalgono a Hans Peter Luhn, ricercatore IBM che nel 1953 descrisse in un memorandum interno l'idea di collocare i dati in base a un codice ricavato dal loro contenuto. L'origine del nome è incerta: l'ipotesi più accreditata lo collega al significato culinario di hash, sminuzzare e mescolare, perché la funzione trita l'input e ne rimescola i pezzi. Il termine si consolidò nella letteratura informatica negli anni '60.

Related terms

More in Fondamenti AI

Put it into practice

From our network

Magellano GPS — Fleet Tracking Made Simple

Real-time GPS tracking, remote engine lock, fuel and CO₂ reporting for your fleet.

Visit magellanogps.com →

From the Agora Intelligence blog

More on agora-intelligence.com →

📱 Download the Android app (beta) iOS coming soon

Say what you mean. Get what you need.

Grace Certified — the AI coach that trains and certifies your prompt engineering — by Agora Intelligence.