Suggest an editImprove this articleRefine the answer for “What is the idea behind hashing?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)The **idea behind hashing** is to use a special function (a **hash function**) to quickly turn arbitrary data (for example, a string or an object) into a **fixed number, a hash**. **Key point:** hashing turns search into computation - instead of comparing every element, we simply compute a number and go straight to the address.Shown above the full answer for quick recall.Answer (EN)ImageThe **idea behind hashing** is to use a special function (a **hash function**) to quickly turn arbitrary data (for example, a string or an object) into a **fixed number, a hash**. This number is used as an **address** for storing or looking up data in a structure, for example in a hash table. ## Main goal Cut down search time: instead of scanning every element, we compute right away *where exactly* the needed object should be. ## Key properties of hashing 1. **Fast computation**, the hash must be computed quickly. 2. **Even distribution**, different keys should produce different (or at least evenly distributed) hashes. 3. **Determinism**, the same key always produces the same hash. ## Example If we need to store users by name: ```javascript hash("Alice") → 42 hash("Bob") → 17 hash("Maria") → 93 ``` Each name immediately goes to "its own" slot in the table. In other words, **hashing turns search into computation**: instead of a long comparison of every element, we simply compute a number and go to the address.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.