What a cryptographic hash does
A hash function turns input of any length into a fixed-length digest. The same bytes produce the same digest, while a small input change produces a substantially different result.
Hashes are not encryption
A digest cannot be decrypted, but weak or predictable inputs can still be guessed. Plain SHA hashes are not appropriate for storing passwords; use a password-specific function such as Argon2id, scrypt, or bcrypt.
Checking integrity
Compare a trusted published checksum with a locally calculated digest to detect accidental or malicious file changes. This version hashes text rather than files.