| 1 |
.\" -*- mode: troff; coding: utf-8 -*- |
| 2 |
.\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) |
| 3 |
.\" |
| 4 |
.\" Standard preamble: |
| 5 |
.\" ======================================================================== |
| 6 |
.de Sp \" Vertical space (when we can't use .PP) |
| 7 |
.if t .sp .5v |
| 8 |
.if n .sp |
| 9 |
.. |
| 10 |
.de Vb \" Begin verbatim text |
| 11 |
.ft CW |
| 12 |
.nf |
| 13 |
.ne \\$1 |
| 14 |
.. |
| 15 |
.de Ve \" End verbatim text |
| 16 |
.ft R |
| 17 |
.fi |
| 18 |
.. |
| 19 |
.\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. |
| 20 |
.ie n \{\ |
| 21 |
. ds C` "" |
| 22 |
. ds C' "" |
| 23 |
'br\} |
| 24 |
.el\{\ |
| 25 |
. ds C` |
| 26 |
. ds C' |
| 27 |
'br\} |
| 28 |
.\" |
| 29 |
.\" Escape single quotes in literal strings from groff's Unicode transform. |
| 30 |
.ie \n(.g .ds Aq \(aq |
| 31 |
.el .ds Aq ' |
| 32 |
.\" |
| 33 |
.\" If the F register is >0, we'll generate index entries on stderr for |
| 34 |
.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index |
| 35 |
.\" entries marked with X<> in POD. Of course, you'll have to process the |
| 36 |
.\" output yourself in some meaningful fashion. |
| 37 |
.\" |
| 38 |
.\" Avoid warning from groff about undefined register 'F'. |
| 39 |
.de IX |
| 40 |
.. |
| 41 |
.nr rF 0 |
| 42 |
.if \n(.g .if rF .nr rF 1 |
| 43 |
.if (\n(rF:(\n(.g==0)) \{\ |
| 44 |
. if \nF \{\ |
| 45 |
. de IX |
| 46 |
. tm Index:\\$1\t\\n%\t"\\$2" |
| 47 |
.. |
| 48 |
. if !\nF==2 \{\ |
| 49 |
. nr % 0 |
| 50 |
. nr F 2 |
| 51 |
. \} |
| 52 |
. \} |
| 53 |
.\} |
| 54 |
.rr rF |
| 55 |
.\" ======================================================================== |
| 56 |
.\" |
| 57 |
.IX Title "SHASUM 1" |
| 58 |
.TH SHASUM 1 2026-04-10 "perl v5.40.1" "Perl Programmers Reference Guide" |
| 59 |
.\" For nroff, turn off justification. Always turn off hyphenation; it makes |
| 60 |
.\" way too many mistakes in technical documents. |
| 61 |
.if n .ad l |
| 62 |
.nh |
| 63 |
.SH NAME |
| 64 |
shasum \- Print or Check SHA Checksums |
| 65 |
.SH SYNOPSIS |
| 66 |
.IX Header "SYNOPSIS" |
| 67 |
.Vb 3 |
| 68 |
\& Usage: shasum [OPTION]... [FILE]... |
| 69 |
\& Print or check SHA checksums. |
| 70 |
\& With no FILE, or when FILE is \-, read standard input. |
| 71 |
\& |
| 72 |
\& \-a, \-\-algorithm 1 (default), 224, 256, 384, 512, 512224, 512256 |
| 73 |
\& \-b, \-\-binary read in binary mode |
| 74 |
\& \-c, \-\-check read SHA sums from the FILEs and check them |
| 75 |
\& \-\-tag create a BSD\-style checksum |
| 76 |
\& \-t, \-\-text read in text mode (default) |
| 77 |
\& \-U, \-\-UNIVERSAL read in Universal Newlines mode |
| 78 |
\& produces same digest on Windows/Unix/Mac |
| 79 |
\& \-0, \-\-01 read in BITS mode |
| 80 |
\& ASCII \*(Aq0\*(Aq interpreted as 0\-bit, |
| 81 |
\& ASCII \*(Aq1\*(Aq interpreted as 1\-bit, |
| 82 |
\& all other characters ignored |
| 83 |
\& |
| 84 |
\& The following five options are useful only when verifying checksums: |
| 85 |
\& \-\-ignore\-missing don\*(Aqt fail or report status for missing files |
| 86 |
\& \-q, \-\-quiet don\*(Aqt print OK for each successfully verified file |
| 87 |
\& \-s, \-\-status don\*(Aqt output anything, status code shows success |
| 88 |
\& \-\-strict exit non\-zero for improperly formatted checksum lines |
| 89 |
\& \-w, \-\-warn warn about improperly formatted checksum lines |
| 90 |
\& |
| 91 |
\& \-h, \-\-help display this help and exit |
| 92 |
\& \-v, \-\-version output version information and exit |
| 93 |
\& |
| 94 |
\& When verifying SHA\-512/224 or SHA\-512/256 checksums, indicate the |
| 95 |
\& algorithm explicitly using the \-a option, e.g. |
| 96 |
\& |
| 97 |
\& shasum \-a 512224 \-c checksumfile |
| 98 |
\& |
| 99 |
\& The sums are computed as described in FIPS PUB 180\-4. When checking, |
| 100 |
\& the input should be a former output of this program. The default |
| 101 |
\& mode is to print a line with checksum, a character indicating type |
| 102 |
\& (\`*\*(Aq for binary, \` \*(Aq for text, \`U\*(Aq for UNIVERSAL, \`^\*(Aq for BITS), |
| 103 |
\& and name for each FILE. The line starts with a \`\e\*(Aq character if the |
| 104 |
\& FILE name contains either newlines or backslashes, which are then |
| 105 |
\& replaced by the two\-character sequences \`\en\*(Aq and \`\e\e\*(Aq respectively. |
| 106 |
\& |
| 107 |
\& Report shasum bugs to [email protected] |
| 108 |
.Ve |
| 109 |
.SH DESCRIPTION |
| 110 |
.IX Header "DESCRIPTION" |
| 111 |
Running \fIshasum\fR is often the quickest way to compute SHA message |
| 112 |
digests. The user simply feeds data to the script through files or |
| 113 |
standard input, and then collects the results from standard output. |
| 114 |
.PP |
| 115 |
The following command shows how to compute digests for typical inputs |
| 116 |
such as the NIST test vector "abc": |
| 117 |
.PP |
| 118 |
.Vb 1 |
| 119 |
\& perl \-e "print qq(abc)" | shasum |
| 120 |
.Ve |
| 121 |
.PP |
| 122 |
Or, if you want to use SHA\-256 instead of the default SHA\-1, simply say: |
| 123 |
.PP |
| 124 |
.Vb 1 |
| 125 |
\& perl \-e "print qq(abc)" | shasum \-a 256 |
| 126 |
.Ve |
| 127 |
.PP |
| 128 |
Since \fIshasum\fR mimics the behavior of the combined GNU \fIsha1sum\fR, |
| 129 |
\&\fIsha224sum\fR, \fIsha256sum\fR, \fIsha384sum\fR, and \fIsha512sum\fR programs, |
| 130 |
you can install this script as a convenient drop-in replacement. |
| 131 |
.PP |
| 132 |
Unlike the GNU programs, \fIshasum\fR encompasses the full SHA standard by |
| 133 |
allowing partial-byte inputs. This is accomplished through the BITS |
| 134 |
option (\fI\-0\fR). The following example computes the SHA\-224 digest of |
| 135 |
the 7\-bit message \fI0001100\fR: |
| 136 |
.PP |
| 137 |
.Vb 1 |
| 138 |
\& perl \-e "print qq(0001100)" | shasum \-0 \-a 224 |
| 139 |
.Ve |
| 140 |
.SH AUTHOR |
| 141 |
.IX Header "AUTHOR" |
| 142 |
Copyright (C) 2003\-2023 Mark Shelor <[email protected]>. |
| 143 |
.SH "SEE ALSO" |
| 144 |
.IX Header "SEE ALSO" |
| 145 |
\&\fIshasum\fR is implemented using the Perl module Digest::SHA. |