1 <!-- manual page source format generated by PolyglotMan v3.2, -->
2 <!-- available at http://polyglotman.sourceforge.net/ -->
6 <title>RHASH(
1) manual page
</title>
9 <a href='#toc'
>Table of Contents
</a><p>
11 <h2><a name='sect0' href='#toc0'
>Name
</a></h2>
12 rhash - calculate/check CRC32, MD5, SHA1, GOST, TTH, BTIH or other hash
14 <h2><a name='sect1' href='#toc1'
>Synopsis
</a></h2>
15 <b>rhash [
</b> <i>option
</i> <b>]... [
</b> <i>file
</i> <b>]...
</b>
16 <h2><a name='sect2' href='#toc2'
>Description
</a></h2>
17 <b>RHash
</b> (Recursive Hasher)
18 computes and verifies various message digests (hash sums) of files. Supported
19 message digests include CRC32, MD4, MD5, SHA1, SHA256, SHA512, SHA3, Tiger,
20 DC++ TTH, BitTorrent BTIH, AICH, ED2K, GOST R
34.11-
94, RIPEMD-
160, HAS-
160,
21 EDON-R
256/
512, Whirlpool, Snefru-
128/
256.
22 <p> The program can create and verify
23 Magnet links and eDonkey ed2k:// links, see --magnet and --ed2k-link options.
25 <p> A dash string parameter
‘-
’ is interpreted as stdin file.
26 <p> By default
<b>rhash
</b>
27 prints sums in SFV format with CRC32 hash sum only. The format can be changed
28 by options --bsd, --magnet, --simple, --printf, --template. To output all sums use
29 the
‘-a
’ option.
30 <p> The default output format can also be changed by renaming
31 the program or placing a hardlink/symlink to it with a name containing
32 strings
‘crc32
’,
‘md4
’,
‘md5
’,
‘sha1
’,
‘sha256
’ ‘sha512
’,
‘tiger
’,
‘tth
’,
‘btih
’,
‘aich
’,
‘ed2k
’,
33 ‘ed2k-link
’,
‘gost
’,
‘gost-cryptopro
’,
‘ripemd160
’,
‘has160
’,
‘whirlpool
’,
‘edonr256
’,
34 ‘edonr512
’,
‘snefru128
’,
‘snefru256
’,
‘sfv
’ or
‘magnet
’.
36 <h2><a name='sect3' href='#toc3'
>Program Mode Options
</a></h2>
38 default mode is to print hash sums for all files and directory trees specified
39 by command line. The mode can be set by the following options.
44 hash files specified by command line. RHash can verify hash files in SFV
45 and BSD formats, standard MD5 and SHA1 files, and text files containing
46 magnet or ed2k links (one link per line). Empty lines and lines starting
47 with
‘;
’ or
‘#
’ are skipped. In fact RHash can verify most hash files generated
48 by itself without formating options --printf and --template.
</dd>
52 hash files specified by command line. The program calculates and appends
53 hashes to the updated hash file in the format specified by formating options.
54 Hashes are calculated for those files from the same directory as the hash
55 file, which are yet not present in it.
</dd>
57 <dt>-k, --check-embedded
</dt>
58 <dd>Verify files by crc32
59 sum embedded in their names.
</dd>
62 <dd>Create a torrent file for each processed
66 <dd>Help: print help screen and exit.
</dd>
68 <dt>-V, --version
</dt>
69 <dd>Version: print version
72 <dt>-B, --benchmark
</dt>
73 <dd>Run benchmark for selected algorithm(s).
77 <h2><a name='sect4' href='#toc4'
>Hash Sums
83 <dd>CRC32: calculate and print CRC32 hash sum.
</dd>
87 and print MD4 hash sum.
</dd>
90 <dd>MD5: calculate and print MD5 hash sum.
</dd>
94 calculate and print SHA1 hash sum.
</dd>
96 <dt>--sha224, --sha256, --sha384, --sha512
</dt>
98 specified SHA2 hash sum.
</dd>
100 <dt>--sha3-
224, --sha3-
256, --sha3-
384, --sha3-
512</dt>
101 <dd>Calculate specified
105 <dd>Tiger: calculate and print Tiger hash sum.
</dd>
109 calculate and print DC++ TTH sum.
</dd>
112 <dd>BTIH: calculate and print BitTorrent
116 <dd>AICH: calculate and print AICH hash.
</dd>
120 and print eDonkey
2000 hash sum.
</dd>
122 <dt>-L, --ed2k-link
</dt>
123 <dd>eDonkey link: calculate and
124 print eDonkey link.
</dd>
126 <dt>-W, --whirlpool
</dt>
127 <dd>Whirlpool: calculate and print Whirlpool
131 <dd>GOST: calculate and print GOST R
34.11-
94 hash, the Russian
132 GOST standard hash function.
</dd>
134 <dt>--gost-cryptopro
</dt>
135 <dd>GOST-CRYPTOPRO: calculate and print
136 CryptoPro version of the GOST R
34.11-
94 hash function.
</dd>
140 calculate and print RIPEMD-
160 hash sum.
</dd>
143 <dd>HAS-
160: calculate and print
144 HAS-
160 hash sum.
</dd>
146 <dt>--snefru128, --snefru256
</dt>
147 <dd>SNEFRU: calculate and print SNEFRU-
128/
256
150 <dt>--edonr256, --edonr512
</dt>
151 <dd>EDON-R: calculate and print EDON-R
256/
512 hash
156 <dd>Calculate all supported hash sums.
</dd>
158 <dt>--list-hashes
</dt>
159 <dd>List names of all
160 supported hashes, one per line.
164 <h2><a name='sect5' href='#toc5'
>Miscellaneous Options
</a></h2>
168 <dt>-r, --recursive
</dt>
170 directories recursively.
</dd>
172 <dt>-v, --verbose
</dt>
173 <dd>Be verbose.
</dd>
176 <dd>Show percents, while
177 calculating or checking sums
</dd>
180 <dd>Don
’t print OK messages for successfully
181 verified files.
</dd>
183 <dt>-i, --ignore-case
</dt>
184 <dd>Ignore case of filenames when updating crc
188 <dd>Print per-file and the total processing speed.
</dd>
190 <dt>-e, --embed-crc
</dt>
192 files by inserting crc32 sum into name.
</dd>
194 <dt>--embed-crc-delimiter=
<delimiter
></dt>
196 specified
<delimiter
> before a crc sum in the --embed-crc mode, default is
197 white space. The
<delimiter
> can be a character or empty string.
</dd>
199 <dt>--path-separator=
<separator
></dt>
201 specified path separator to display paths.
</dd>
203 <dt>-q, --accept=
<list
></dt>
204 <dd>Set a comma-delimited
205 list of extensions of the files to process.
</dd>
207 <dt>--exclude=
<list
></dt>
208 <dd>Set a comma-delimited
209 list of extensions of the files to exclude from processing.
</dd>
211 <dt>-t, --crc-accept=
<list
></dt>
213 a comma-delimited list of extensions of the hash files to verify.
</dd>
215 <dt>--maxdepth=
<levels
></dt>
217 at most
<levels
> (a non-negative integer) levels of directories below the
218 command line arguments.
‘--maxdepth
0’ means only apply the tests and actions
219 to the command line arguments.
</dd>
221 <dt>-o, --output=
<file-path
></dt>
222 <dd>Set the file to output
223 calculated hashes and verification results to.
</dd>
225 <dt>-l, --log=
<file-path
></dt>
227 to log errors and verbose information to.
</dd>
229 <dt>--openssl=
<list
></dt>
230 <dd>Specify which hash
231 functions should be calculated using the OpenSSL library. The
<list
> is a
232 comma delimited list of hash names, but only those supported by openssl
233 are allowed, e.g. md4, md5, sha1, sha256, ripemd160. See openssl documentation
234 for the full list.
</dd>
236 <dt>--gost-reverse
</dt>
237 <dd>Reverse bytes in hexadecimal output of the
238 GOST hash sum. The most significant bytes of the hash will be printed first.
239 Default order is the least significant bytes first.
</dd>
241 <dt>--bt-batch=
<file-path
></dt>
243 on torrent batch mode (implies torrent mode). Calculates batch-torrent for
244 the files specified at command line and saves the torrent file to the file-path.
245 The option -r
<directory
> can be useful in this mode.
</dd>
247 <dt>--bt-private
</dt>
249 for a private BitTorrent tracker.
</dd>
251 <dt>--bt-piece-length
</dt>
252 <dd>Set the
<i>piece length
</i> value
253 for torrent file.
</dd>
255 <dt>--bt-announce=
<announce-url
></dt>
256 <dd>Add a tracker announce URL to the
257 created torrent file(s). Several URLs can be passed by specifying the option
258 mutltiple times. This option doesn
’t change the BTIH hash.
</dd>
260 <dt>--benchmark-raw
</dt>
262 benchmark output format to be a machine-readable tab-delimited text with
263 hash function name, speed, cpu clocks per byte. This option works only if
264 the --benchmark option was specified.
</dd>
266 <dt>-- (double dash)
</dt>
267 <dd>Mark the end of command
268 line options. All parameters following the double dash are interpreted as
269 files or directories. It is typically used to process filenames starting
270 with a dash
‘-
’. Alternatively you can specify
’./
’ or full path before such files,
271 so they will not look like options anymore.
275 <h2><a name='sect6' href='#toc6'
>Output Format Options
</a></h2>
281 Windows codepage for output.
</dd>
284 <dd>Use DOS (OEM) codepage for output.
</dd>
288 UTF-
8 codepage for output.
</dd>
291 <dd>Print hash sums in the SFV (Simple File Verification)
292 output format (default). But unlike common SFV file, not only CRC32, but
293 any hash sums specified by options can be printed.
</dd>
295 <dt>-m, --magnet
</dt>
297 formatted as magnet links.
</dd>
300 <dd>Use BSD output format. Each hash sum is printed
301 on separate line after hash name and file
’s path, enclosed in parentheses.
305 <dd>Use simple output format. Each line will consist of filename and hash
306 sums specified by options.
</dd>
309 <dd>Print hash sums in upper case.
</dd>
313 hash sums in lower case.
</dd>
315 <dt>--template=
<file
></dt>
316 <dd>Read printf-like template from given
317 <file
>. See the --printf option.
</dd>
319 <dt>-p, --printf=
<format
></dt>
320 <dd>Format: print
<i>format
</i> string
321 the standard output, interpreting
‘\
’ escapes and
‘%
’ directives. The escapes
322 and directives are:
<blockquote></dd>
328 <dd>Carriage return.
</dd>
331 <dd>Horizontal tab.
</dd>
335 backslash (
‘\
’).
</dd>
341 <dd>The character which octal ASCII code is NNN.
345 <dd>The character which hexadecimal ASCII code is NN.
</dd>
348 A
‘\
’ character followed
349 by any other character is treated as an ordinary character, so they both
354 <dd>A literal percent sign.
</dd>
357 <dd>File
’s path.
</dd>
360 <dd>File
’s name.
</dd>
367 <dd>File
’s size in bytes.
</dd>
370 <dd>File
’s last modification time.
</dd>
374 <dd>AICH hash sum.
</dd>
377 <dd>CRC32 hash sum. Use %c for lowercase and %C
378 for uppercase characters.
</dd>
381 <dd>GOST R
34.11-
94 hash.
</dd>
388 <dd>ED2K hash sum.
</dd>
391 <dd>EDonkey ed2k://... link.
</dd>
398 <dd>RIPEMD-
160 hash.
</dd>
404 <dd>Whirlpool hash.
</dd>
406 <dt>%{md4}, %{sha-
224},
407 %{sha-
256}, %{sha-
384}, %{sha-
512}, %{sha3-
224},
</dt>
408 <dd> %{sha3-
256}, %{sha3-
384}, %{sha3-
512}
409 %{tiger}, %{btih}, %{gost-cryptopro},
<br>
410 %{has160}, %{snefru128}, %{snefru256}, %{edon-r256}, %{edon-r512}
"<br>
411 Print specified hash sum. Actually the %{<hash sum>} directive can print
412 any supported hash sum. If a hash sum name starts with a capital letter
413 then the hash is printed in uppercase, e.g. %{TTH}, %{Sha-512}. </dd>
415 <dt>%x<hash>, %b<hash>,
416 %B<hash>, %@<hash></dt>
417 <dd>Use one of these prefixes to output a hash sum in hexadecimal,
418 base32, base64 or raw (binary) format respectively, e.g. %b{md4}, %BH or
424 <h2><a name='sect7' href='#toc7'>Config File</a></h2>
425 RHash looks for a config file on Windows at %APPDATA%\RHash\rhashrc,
427 <p>%HOMEDRIVE%%HOMEPATH%\rhashrc
428 <p> and on Linux/Unix at $HOME/.rhashrc and /etc/rhashrc.
430 <p> The config file consists of lines formatted as <blockquote>variable = value </blockquote>
433 the <i>variable</i> can be a name of any command line option, like <i>magnet,</i> <i>printf,</i>
434 <i>percents,</i> etc. A boolean variable can be set to true by a value ‘on’, ‘yes’
435 or ‘true’, any other value sets the variable to false.
436 <p> Empty lines and lines
437 starting with ‘#’ or ‘;’ are ignored.
438 <p> Example config file: <br>
439 <pre># This is a comment line
441 crc-accept = .sfv,.md5,.sha1,.sha256,.sha512,.tth,.magnet
444 <h2><a name='sect8' href='#toc8'>Author</a></h2>
445 Aleksey Kravchenko <rhash.admin@gmail.com>
446 <h2><a name='sect9' href='#toc9'>See Also</a></h2>
447 <i><b>md5sum</b>(1)</i> <i><b>cksfv</b>(1)</i>
448 <i><b>ed2k_hash</b>(1)</i>
449 <h2><a name='sect10' href='#toc10'>Bugs</a></h2>
450 Bug reports are welcome! Send them by email or post to
451 the SourceForge Bug Tracking System <i><i>http://sourceforge.net/projects/rhash/</i></i>
455 <a name='toc'><b>Table of Contents</b></a><p>
457 <li><a name='toc0' href='#sect0'>Name</a></li>
458 <li><a name='toc1' href='#sect1'>Synopsis</a></li>
459 <li><a name='toc2' href='#sect2'>Description</a></li>
460 <li><a name='toc3' href='#sect3'>Program Mode Options</a></li>
461 <li><a name='toc4' href='#sect4'>Hash Sums Options</a></li>
462 <li><a name='toc5' href='#sect5'>Miscellaneous Options</a></li>
463 <li><a name='toc6' href='#sect6'>Output Format Options</a></li>
464 <li><a name='toc7' href='#sect7'>Config File</a></li>
465 <li><a name='toc8' href='#sect8'>Author</a></li>
466 <li><a name='toc9' href='#sect9'>See Also</a></li>
467 <li><a name='toc10' href='#sect10'>Bugs</a></li>