sha man page

sha — file hashing utility



[-12345Vh] [file ...]


sha is a simple program that hashes files. It uses the National Institute of Standards and Technology's Secure Hash Algorithm. It can use SHA-1, SHA-256, SHA-384, or SHA-512, which generate respectively, hashes of 160, 256, 384, or 512 bits. sha can be used in scripts to do, for example, file integrity checking.



Use SHA-1, which produces a 160-bit hash (40 hex digits).


Use SHA-256, which produces a 256-bit hash (64 hex digits).


Use SHA-384, which produces a 384-bit hash (96 hex digits).


Use SHA-512, which produces a 512-bit hash (128 hex digits).


Display version information.


Display help summary.

file ...

One or more files to hash. If no files are given, stdin is hashed.

If neither -1, -2, -3, or -5 are given, then SHA-1 is used. (But see note about SHA_DEFAULT below.)



The default hash algorithm to use. “1” denotes SHA-1, “2” denotes SHA-256, “3” denotes SHA-384, and “5” denotes SHA-512. Only the first character is significant. If not defined, SHA-1 is the default.


August 19, 2001