digest

The short, fixed-size output of a hash function, which acts as a fingerprint of the input data.

In more detail

Any change to the input, even one character, produces a completely different digest, so comparing digests shows whether data has changed. A SHA-256 digest is always 32 bytes, shown as 64 hexadecimal characters, whether the input is a password or a ten-megabyte file. A digest proves integrity only if the expected value came from somewhere an attacker cannot alter, such as a signed release page or an offline manifest.

Examples

sha256sum changes.csv sample.txt results.csv > manifest.sha256
return hashlib.file_digest(f, "sha256").hexdigest()
ten megabytes in, 32 bytes out

Related terms

Taught in

References