hash

A short fixed-length fingerprint calculated from data, which changes completely if even one byte of the data changes.

In more detail

A cryptographic hash function such as SHA-256 is designed so that you cannot find two different inputs with the same fingerprint, and cannot work backwards from the fingerprint to the data. That makes a hash a reliable name for content and a quick check that data was not corrupted or tampered with. The same input always gives the same hash.

Examples

Kafka partitioners hash the record key with murmur2 to choose a partition.
The course build prints a checksum of the archive as its digest, so any later stage can check it holds exactly the bytes that were tested.
In the browser: The same input always gives the same hash, but you cannot work backwards from the hash to the input. Hashes are used to check that data has not been changed and to name content by what it contains.
createHash("sha256").update(input).digest("hex")
printf 'Revenue is up.\n' | git hash-object --stdin prints the hash Git would use as that content's name.
sha256sum healthcheck > healthcheck.sha256
A cryptographic hash function such as SHA-256 is designed so you cannot find two inputs with the same result or work backwards to the input. Linux uses hashes to store passwords and to check downloaded packages against their signed repository index. A hash-based load balancer uses a non-cryptographic hash of the client address to keep choosing the same backend.
Sysmon records SHA-256, MD5 and imphash values for each process image; imaging tools hash evidence while copying it.
Flipping one bit of wheel.bin changes its SHA-256 digest completely
In Terraform: The dependency lock file stores hashes of each provider package, and terraform init refuses a download whose hash does not match. Plans also show file checksums as known after apply, because a file that does not exist yet cannot be fingerprinted.

Related terms

Taught in

References

Certification courses