1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
4
<title>shasum - perldoc.perl.org</title>
5
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
6
<meta http-equiv="Content-Language" content="en-gb" />
7
<link href="css.css" rel="stylesheet" rev="stylesheet" type="text/css" media="screen" />
10
<script language="JavaScript" type="text/javascript" src="label.js"></script>
12
<script language="JavaScript">
17
<body onLoad="showToolbars();loadLabels()">
20
<div id="pageHeaderLogo">
23
<div id="pageHeaderText">
24
<a href="http://perldoc.perl.org">perldoc.perl.org</a>
30
<div id="leftContent">
32
<a href="#" onClick="closeLeft()" title="Hide navigation" onmouseover="leftCloseIcon.src='close_purple.gif';" onmouseout="leftCloseIcon.src='close_blue.gif';"><img src="close_blue.gif" name="leftCloseIcon" id="leftCloseIcon" border=0></a>
36
<li><a href="index-overview.html">Overview</a></li>
37
<li><a href="index-tutorials.html">Tutorials</a></li>
38
<li><a href="index-faq.html">FAQs</a></li>
39
<li><a href="index-history.html">History / Changes</a></li>
40
<li><a href="index-licence.html">Licence</a></li>
44
<li><a href="index-language.html">Language</a></li>
45
<li><a href="index-functions.html">Functions</a></li>
46
<li><a href="perlop.html">Operators</a></li>
47
<li><a href="perlvar.html">Special variables</a></li>
48
<li><a href="index-pragmas.html">Pragmas</a></li>
49
<li><a href="index-modules-A.html">Core modules</a></li>
50
<li><a href="index-utilities.html">Utilities</a></li>
51
<li><a href="index-internals.html">Internals</a></li>
52
<li><a href="index-platforms.html">Platform specific</a></li>
56
<li><a href="http://search.cpan.org">CPAN</a></li>
57
<li><a href="http://www.perl.org">Perl.org</a></li>
58
<li><a href="http://www.perl.com">Perl.com</a></li>
59
<li><a href="http://perlbuzz.com">Perl Buzz</a></li>
60
<li><a href="http://www.perlfoundation.org/perl5/index.cgi">Perl 5 Wiki</a></li>
61
<li><a href="http://jobs.perl.org">Perl Jobs</a></li>
62
<li><a href="http://www.pm.org">Perl Mongers</a></li>
63
<li><a href="http://www.perlmonks.org">Perl Monks</a></li>
64
<li><a href="http://planet.perl.org">Planet Perl</a></li>
65
<li><a href="http://use.perl.org">Use Perl</a></li>
69
<li>Site maintained by<br><a href="http://perl.jonallen.info">Jon Allen</a>
70
(<a href="http://perl.jonallen.info">JJ</a>)</li>
71
<li class="spaced">Last updated on<br>23 December 2007</li>
72
<li class="spaced">See the <a href="http://perl.jonallen.info/projects/perldoc">project page</a> for
79
<div id="centerContent">
80
<div id="contentHeader">
81
<div id="contentHeaderLeft"><a href="#" onClick="showLeft()">Show navigation</a></div>
82
<div id="contentHeaderCentre">-- Perl 5.10.0 documentation --</div>
83
<div id="contentHeaderRight"><a href="#" onClick="showRight()">Show toolbar</a></div>
85
<div id="breadCrumbs"><a href="index.html">Home</a> > <a href="index-utilities.html">Utilities</a> > shasum</div>
86
<script language="JavaScript">fromSearch();</script>
87
<div id="contentBody"><div class="title_container"><div class="page_title">shasum</div></div><ul><li><a href="#NAME">NAME</a><li><a href="#SYNOPSIS">SYNOPSIS</a><li><a href="#DESCRIPTION">DESCRIPTION</a><li><a href="#AUTHOR">AUTHOR</a><li><a href="#SEE-ALSO">SEE ALSO</a></ul><a name="NAME"></a><h1>NAME</h1>
88
<p>shasum - Print or Check SHA Checksums</p>
89
<a name="SYNOPSIS"></a><h1>SYNOPSIS</h1>
90
<pre class="verbatim"> Usage: shasum [OPTION] [FILE]...
91
or: shasum [OPTION] --check [FILE]
92
Print or check SHA checksums.
93
With no FILE, or when FILE is -, read standard input.</pre><pre class="verbatim"> -a, --algorithm 1 (default), 224, 256, 384, 512
94
-b, --binary read files in binary mode (default on DOS/Windows)
95
-c, --check check SHA sums against given list
96
-p, --portable read files in portable mode
97
produces same digest on Windows/Unix/Mac
98
-t, --text read files in text mode (default)</pre><pre class="verbatim"> The following two options are useful only when verifying checksums:</pre><pre class="verbatim"> -s<span class="cm">,</span> --<span class="w">status</span> <span class="w">don't</span> <span class="w">output</span> <span class="w">anything</span><span class="cm">,</span> <span class="w">status</span> <span class="w">code</span> <span class="w">shows</span> <span class="w">success</span>
99
-w<span class="cm">,</span> --<a class="l_k" href="functions/warn.html">warn</a> <a class="l_k" href="functions/warn.html">warn</a> <span class="w">about</span> <span class="w">improperly</span> <span class="w">formatted</span> <span class="w">SHA</span> <span class="w">checksum</span> <span class="w">lines</span></pre>
100
<pre class="verbatim"> -<span class="w">h</span><span class="cm">,</span> --<span class="w">help</span> <span class="w">display</span> <span class="w">this</span> <span class="w">help</span> and <a class="l_k" href="functions/exit.html">exit</a>
101
-<span class="w">v</span><span class="cm">,</span> --<span class="w">version</span> <span class="w">output</span> <span class="w">version</span> <span class="w">information</span> and <a class="l_k" href="functions/exit.html">exit</a></pre>
102
<pre class="verbatim"> The sums are computed as described in FIPS PUB 180-2. When checking,
103
the input should be a former output of this program. The default mode
104
is to print a line with checksum, a character indicating type (`*'
105
for binary, `?' for portable, ` ' for text), and name for each FILE.</pre><a name="DESCRIPTION"></a><h1>DESCRIPTION</h1>
106
<p>The <i>shasum</i> script provides the easiest and most convenient way to
107
compute SHA message digests. Rather than writing a program, the user
108
simply feeds data to the script via the command line, and waits for
109
the results to be printed on standard output. Data can be fed to
110
<i>shasum</i> through files, standard input, or both.</p>
111
<p>The following command shows how easy it is to compute digests for typical
112
inputs such as the NIST test vector "abc":</p>
113
<pre class="verbatim"> <span class="w">perl</span> -e <span class="q">"print qw(abc)"</span> | <span class="w">shasum</span></pre>
114
<p>Or, if you want to use SHA-256 instead of the default SHA-1, simply say:</p>
115
<pre class="verbatim"> <span class="w">perl</span> -e <span class="q">"print qw(abc)"</span> | <span class="w">shasum</span> -<span class="w">a</span> <span class="n">256</span></pre>
116
<p>Since <i>shasum</i> uses the same interface employed by the familiar
117
<i>sha1sum</i> program (and its somewhat outmoded anscestor <i>md5sum</i>),
118
you can install this script as a convenient drop-in replacement.</p>
119
<a name="AUTHOR"></a><h1>AUTHOR</h1>
120
<p>Copyright (c) 2003-2007 Mark Shelor <mshelor@cpan.org>.</p>
121
<a name="SEE-ALSO"></a><h1>SEE ALSO</h1>
122
<p>shasum is implemented using the Perl module <a href="Digest/SHA.html">Digest::SHA</a> or
123
<a href="http://search.cpan.org/perldoc/Digest::SHA::PurePerl">Digest::SHA::PurePerl</a>.</p>
125
<div id="contentFooter"><a href="http://www.perl.org"><img src="perlpowered.png" border=0></a></div>
130
<div id="rightContent">
132
<a href="#" onClick="closeRight()" title="Hide toolbar" onmouseover="rightCloseIcon.src='close_purple.gif';" onmouseout="rightCloseIcon.src='close_blue.gif';"><img src="close_blue.gif" name="rightCloseIcon" id="rightCloseIcon" border=0></a>
136
<form action="search.html" name="perldoc_search">
137
<input type="text" name="q" size="10" class="grey"><br>
138
<!--<select name="r"><option value="1" selected>Go to top result<option value="0">Show results list</select>-->
141
<script language="JavaScript" type="text/javascript" src="/perl-version.js"></script>
144
<a href="#" onClick="addLabel('shasum','shasum.html')">Add this page</a>
146
<div class="labels" id="labels">