Debian Codegraph @

upstream/mageia-cauldron/man1/shasum.1

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (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 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "SHASUM 1"
61 .TH SHASUM 1 2026-05-26 "perl v5.42.0" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 shasum \- Print or Check SHA Checksums
68 .SH SYNOPSIS
69 .IX Header "SYNOPSIS"
70 .Vb 3
71 \& Usage: shasum [OPTION]... [FILE]...
72 \& Print or check SHA checksums.
73 \& With no FILE, or when FILE is \-, read standard input.
74 \&
75 \& \-a, \-\-algorithm 1 (default), 224, 256, 384, 512, 512224, 512256
76 \& \-b, \-\-binary read in binary mode
77 \& \-c, \-\-check read SHA sums from the FILEs and check them
78 \& \-\-tag create a BSD\-style checksum
79 \& \-t, \-\-text read in text mode (default)
80 \& \-U, \-\-UNIVERSAL read in Universal Newlines mode
81 \& produces same digest on Windows/Unix/Mac
82 \& \-0, \-\-01 read in BITS mode
83 \& ASCII \*(Aq0\*(Aq interpreted as 0\-bit,
84 \& ASCII \*(Aq1\*(Aq interpreted as 1\-bit,
85 \& all other characters ignored
86 \&
87 \& The following five options are useful only when verifying checksums:
88 \& \-\-ignore\-missing don\*(Aqt fail or report status for missing files
89 \& \-q, \-\-quiet don\*(Aqt print OK for each successfully verified file
90 \& \-s, \-\-status don\*(Aqt output anything, status code shows success
91 \& \-\-strict exit non\-zero for improperly formatted checksum lines
92 \& \-w, \-\-warn warn about improperly formatted checksum lines
93 \&
94 \& \-h, \-\-help display this help and exit
95 \& \-v, \-\-version output version information and exit
96 \&
97 \& When verifying SHA\-512/224 or SHA\-512/256 checksums, indicate the
98 \& algorithm explicitly using the \-a option, e.g.
99 \&
100 \& shasum \-a 512224 \-c checksumfile
101 \&
102 \& The sums are computed as described in FIPS PUB 180\-4. When checking,
103 \& the input should be a former output of this program. The default
104 \& mode is to print a line with checksum, a character indicating type
105 \& (\`*\*(Aq for binary, \` \*(Aq for text, \`U\*(Aq for UNIVERSAL, \`^\*(Aq for BITS),
106 \& and name for each FILE. The line starts with a \`\e\*(Aq character if the
107 \& FILE name contains either newlines or backslashes, which are then
108 \& replaced by the two\-character sequences \`\en\*(Aq and \`\e\e\*(Aq respectively.
109 \&
110 \& Report shasum bugs to [email protected]
111 .Ve
112 .SH DESCRIPTION
113 .IX Header "DESCRIPTION"
114 Running \fIshasum\fR is often the quickest way to compute SHA message
115 digests. The user simply feeds data to the script through files or
116 standard input, and then collects the results from standard output.
117 .PP
118 The following command shows how to compute digests for typical inputs
119 such as the NIST test vector "abc":
120 .PP
121 .Vb 1
122 \& perl \-e "print qq(abc)" | shasum
123 .Ve
124 .PP
125 Or, if you want to use SHA\-256 instead of the default SHA\-1, simply say:
126 .PP
127 .Vb 1
128 \& perl \-e "print qq(abc)" | shasum \-a 256
129 .Ve
130 .PP
131 Since \fIshasum\fR mimics the behavior of the combined GNU \fIsha1sum\fR,
132 \&\fIsha224sum\fR, \fIsha256sum\fR, \fIsha384sum\fR, and \fIsha512sum\fR programs,
133 you can install this script as a convenient drop\-in replacement.
134 .PP
135 Unlike the GNU programs, \fIshasum\fR encompasses the full SHA standard by
136 allowing partial\-byte inputs. This is accomplished through the BITS
137 option (\fI\-0\fR). The following example computes the SHA\-224 digest of
138 the 7\-bit message \fI0001100\fR:
139 .PP
140 .Vb 1
141 \& perl \-e "print qq(0001100)" | shasum \-0 \-a 224
142 .Ve
143 .SH AUTHOR
144 .IX Header "AUTHOR"
145 Copyright (C) 2003\-2023 Mark Shelor <[email protected]>.
146 .SH "SEE ALSO"
147 .IX Header "SEE ALSO"
148 \&\fIshasum\fR is implemented using the Perl module Digest::SHA.