This commit is contained in:
Miloslav Ciz 2025-01-21 21:53:21 +01:00
parent 1f6026b2ee
commit 61bb2ebca8
23 changed files with 2038 additions and 1922 deletions

View file

@ -1,6 +1,6 @@
# Hash
Hash is a [number](number.md) computed from given data in a [chaotic](chaos.md) way, which serves various useful purposes, e.g. for quick comparisons (instead of comparing big data structures we just compare their hashes) or mapping data structures to table indices.
Hash is a [number](number.md) computed from given [data](data.md) in a [chaotic](chaos.md) way, which serves various useful purposes, e.g. for quick comparisons (instead of comparing big data structures we just compare their hashes) or mapping data structures to table indices.
Hash is computed by a **hash [function](function.md)**: one that takes data on input and outputs a number (the hash) that's in terms of [bit](bit.md) width much smaller than the data itself, has a fixed size (number of [bits](bit.md)) and which has additional properties such as being completely different from hashes of even very similar (but different) data. Thanks to these simple but very useful properties hashes enjoy a very wide range of uses in [computer science](compsci.md) -- they are frequently used for comparisons of bigger data such as documents or compiled programs, or in indexing structures such as **hash tables** which allow for quick search of data, and they also play a big role in [cryptocurrencies](crypto.md) and [security](security.md), e.g. in computing [digital signatures](sigital_signature.md) or storing passwords (for security reasons in databases of users we store just hashes of their passwords, never the passwords themselves). Hashing is exceptionally important and as a programmer you won't be able to avoid encountering hashes somewhere in the wild.