How it works
The text is encoded as UTF-8 bytes and passed to crypto.subtle.digest, the
browser’s built-in implementation of these hash functions. The result is a
fixed-length fingerprint of the input, shown here as hexadecimal.
Hashing is one-way
A hash cannot be reversed back into the original text. The same input always produces the same hash, and changing even one character produces a completely different one — which is what makes hashes useful for verifying that a file or message has not been altered.
Choosing an algorithm
SHA-256 is the standard default: fast, widely supported, and with no known practical attacks. SHA-384 and SHA-512 produce longer digests for a larger security margin. SHA-1 is included only for compatibility with older systems — it should not be relied on for security, since practical collision attacks against it are known.