Home

Hashes

In computing, a hash is the result of a function that maps input data of arbitrary size to a fixed-size output, commonly called a hash value or digest. A good hash function is deterministic, fast to compute, and designed so that small changes in the input produce large, unpredictable changes in the output (the avalanche effect). Hashes are widely used for data integrity, indexing, and content addressing.

Hash functions come in two main varieties: cryptographic hashes and non-cryptographic hashes. Cryptographic hashes, such as

Common applications include verifying data integrity (checksums), creating digital signatures and message authentication codes, and storing

Hash collisions—two distinct inputs producing the same hash—are possible by the pigeonhole principle. Security relies on

SHA-256,
SHA-3,
and
BLAKE3,
aim
to
be
preimage
and
collision
resistant,
making
it
hard
to
recover
inputs
or
find
two
inputs
that
yield
the
same
hash.
Non-cryptographic
hashes,
such
as
MurmurHash
or
CityHash,
are
optimized
for
speed
and
uniform
distribution
but
are
not
secure
against
tampering
and
should
not
be
used
for
security
purposes.
passwords
with
salt
and
key-stretching
algorithms
(for
example
bcrypt,
scrypt,
Argon2).
They
are
also
used
in
content-addressable
storage
and
version
control
where
the
hash
identifies
content,
as
in
Git’s
use
of
hash
digests.
In
data
structures,
hash
functions
underpin
hash
tables
and,
in
distributed
systems,
consistent
hashing.
the
collision
resistance
of
the
chosen
hash;
many
older
hashes
(MD5,
SHA-1)
have
demonstrated
feasible
collisions
and
are
no
longer
considered
secure
for
cryptographic
purposes.
No
hash
function
is
immune
to
all
attacks,
but
a
well-designed
cryptographic
hash
remains
resistant
to
practical
preimage
and
collision
attacks
for
its
intended
lifetime.