.Dd May 1, 2005 .Dt SHA 1 .Os NetBSD 1.4T .Sh NAME .Nm sha .Nd SHA-* checksumming utility .Sh SYNOPSIS .Nm sha .Op Fl flags ... .Op Ar file ... .Nm sha1 .Op Fl flags ... .Op Ar file ... .Nm sha256 .Op Fl flags ... .Op Ar file ... .Nm sha384 .Op Fl flags ... .Op Ar file ... .Nm sha512 .Op Fl flags ... .Op Ar file ... .Sh DESCRIPTION .Nm sha computes SHA, SHA-1, SHA-256, SHA-384, and SHA-512 checksums (see the USA Government Federal Information Processing Standards Publication 180 and its successors). .Pp If no .Ar file Ns names are given, .Nm checksums its standard input; otherwise, it checksums the named files. Each checksum is printed on a separate line. By default, if multiple files were given, each checksum is followed by the name of the file it corresponds to; if only one file was given, or if stdin is being checksummed, the checksum is printed by itself. .Pp Flags currently understood are: .Bl -tag -width indent .It Fl h .It Fl no-names Never print names with the checksums, even when multiple filenames are given. .It Fl H .It Fl names Always print names with the checksums, even when only one filename, or none, is given. (The .Sq name printed when standard input is checksummed is .Dq stdin . ) .It Fl sha Compute SHA checksums. This is the default if run as .Nm sha . .It Fl sha1 Compute SHA-1 checksums. This is the default if run as .Nm sha1 . .It Fl sha256 Compute SHA-256 checksums. This is the default if run as .Nm sha256 . .It Fl sha384 Compute SHA-384 checksums. This is the default if run as .Nm sha384 . .It Fl sha512 Compute SHA-512 checksums. This is the default if run as .Nm sha512 . .El .Pp Exit status is a count of the number of files that couldn't be opened (normally zero). Such files produce a complaint on stderr instead of a checksum line on stdout. .Pp If the command basename is none of the recognized names .Pf ( Nm sha , .Nm sha1 , .Nm sha256 , .Nm sha384 , or .Nm sha512 ) , then one of the .Fl sha* flags must be given. .Sh EXAMPLES .Bd -literal -offset indent % echo -n abc | sha 0164b8a9 14cd2a5e 74c4f7ff 082c4d97 f1edf880 % cat file1 This is file #1. % cat file2 This is (slightly longer) file #2. It has two lines. % sha file1 file2 351529d4 26a39f43 2b319eed 46fa928d 0f350d89 file1 3589bb6c fb45a619 5eba8a87 f50468c2 7105776b file2 % .Ed .Sh AUTHOR der Mouse, .Aq mouse@rodents.montreal.qc.ca .