1RHASH(1)                         User Manuals                         RHASH(1)
2
3
4

NAME

6       rhash - calculate/check CRC32, MD5, SHA1, GOST, TTH, BTIH or other mes‐
7       sage digests.
8

SYNOPSIS

10       rhash [ option ]... [ file ]...
11

DESCRIPTION

13       RHash (Recursive Hasher) computes and verifies various message  digests
14       and  checksums  of  files.   Supported  hash  algorithms include CRC32,
15       CRC32C, MD4, MD5, SHA1, SHA256, SHA512, SHA3, Tiger,  DC++  TTH,  BTIH,
16       AICH,  ED2K,  GOST  R  34.11-*,  RIPEMD-160,  HAS-160,  EDON-R 256/512,
17       Whirlpool, Snefru-128/256.
18
19       The program can create and verify  Magnet  links  and  eDonkey  ed2k://
20       links, see --magnet and --ed2k-link options.
21
22       A dash string parameter `-' is interpreted as the standard input stream
23       (stdin).
24
25       By default rhash prints sums in SFV format with  CRC32  checksum  only.
26       The  format  can  be  changed  by  options  --bsd,  --magnet, --simple,
27       --printf, --template.  To output all sums use the `-a' option.
28
29

PROGRAM MODE OPTIONS

31       The default mode is to print checksums  for  all  files  and  directory
32       trees specified by command line. The mode can be changed by the follow‐
33       ing options.
34
35       -c, --check
36              Check hash files specified by command  line.  RHash  can  verify
37              hash  files in SFV and BSD formats, standard MD5 and SHA1 files,
38              and text files containing magnet or ed2k  links  (one  link  per
39              line).   Empty  lines  and  lines  starting  with `;' or `#' are
40              skipped.  In fact RHash can verify most hash files generated  by
41              itself without formatting options --printf and --template.
42
43       -u, --update=<hash-file>
44              Update the hash file specified by the option.  Checksums will be
45              calculated for all files specified by command and not present in
46              this hash file. The calculated checksums will be appended to the
47              updated hash file in the format specified by formatting options.
48              This  option  can be combined with --recursive, to update a hash
49              file for whole directory trees.
50
51       -k, --check-embedded
52              Verify files by crc32 sum embedded in their names.
53
54       --torrent
55              Create a torrent file for each processed file.
56
57       -h, --help
58              Help: print help screen and exit.
59
60       -V, --version
61              Version: print version and exit.
62
63       -B, --benchmark
64              Run benchmark for the selected hash algorithm(s).
65
66

HASH ALGORITHMS OPTIONS

68       -C, --crc32
69              CRC32: Select CRC32 checksum algorithm.
70
71       --crc32c
72              CRC32C: Select CRC32C checksum algorithm.
73
74       --md4  MD4: Select MD4 hash function.
75
76       -M, --md5
77              MD5: Select MD5 hash function.
78
79       -H, --sha1
80              SHA1: Select SHA1 hash function.
81
82       --sha224, --sha256, --sha384, --sha512
83              Select specified SHA2 hash function.
84
85       --sha3-224, --sha3-256, --sha3-384, --sha3-512
86              Select specified SHA3 hash function.
87
88       --tiger
89              Tiger: Select Tiger hash function.
90
91       -T, --tth
92              TTH: Select DC++ TTH hash function.
93
94       --btih BTIH: Select BitTorrent Info Hash.
95
96       -A, --aich
97              AICH: Select AICH hash function.
98
99       -E, --ed2k
100              ED2K: Select eDonkey 2000 hash function.
101
102       -L, --ed2k-link
103              eDonkey link: calculate and print eDonkey link.
104
105       -W, --whirlpool
106              Whirlpool: Select Whirlpool hash function.
107
108       -G, --gost12-256
109              GOST-2012: Select 256-bit GOST R 34.11-2012,  the  Russian  GOST
110              standard hash function.
111
112       --gost12-512
113              GOST-2012:  Select  512-bit  GOST R 34.11-2012, the Russian GOST
114              standard hash function.
115
116       --gost94
117              GOST-94: Select GOST R 34.11-94,  the  deprecated  Russian  hash
118              function.
119
120       --gost94-cryptopro
121              GOST-94-CRYPTOPRO:  Select  the  CryptoPro version of the depre‐
122              cated Russian GOST R 34.11-94 hash function.
123
124       --ripemd160
125              RIPEMD-160: Select RIPEMD-160 hash function.
126
127       --has160
128              HAS-160: Select HAS-160 hash function.
129
130       --snefru128, --snefru256
131              SNEFRU: Select SNEFRU-128/256 hash function.
132
133       --edonr256, --edonr512
134              EDON-R: Select EDON-R 256/512 hash function.
135
136
137       -a, --all
138              Calculate all supported hash functions.
139
140       --list-hashes
141              List names of all supported hash functions, one per line.
142
143

MISCELLANEOUS OPTIONS

145       -r, --recursive
146              Recursively process directories, specified by command line.
147
148       --file-list=<file>
149              Process given file as a file-list. Lines of this file are inter‐
150              preted  as  paths  to files to be processed. Multiple file lists
151              can be specified at command line.
152
153       -m, --message=<text>
154              Calculate message digests of the given text message.
155
156       --follow
157              Follow symbolic links when processing directories recursively.
158
159       -v, --verbose
160              Be verbose.
161
162       -P, --percents
163              Show percents, while calculating or checking sums
164
165       --skip-ok
166              Don't print OK messages for successfully verified files.
167
168       -i, --ignore-case
169              Ignore case of filenames when updating crc files.
170
171       --speed
172              Print per-file and the total processing speed.
173
174       -e, --embed-crc
175              Rename files by inserting crc32 sum into name.
176
177       --embed-crc-delimiter=<delimiter>
178              Insert specified <delimiter> before a crc sum in the --embed-crc
179              mode, default is white space. The <delimiter> can be a character
180              or empty string.
181
182       --path-separator=<separator>
183              Use specified path separator to display paths.
184
185       -q, --accept=<list>
186              Set a  comma‐delimited  list  of  extensions  of  the  files  to
187              process.
188
189       --exclude=<list>
190              Set a comma‐delimited list of extensions of the files to exclude
191              from processing.
192
193       -t, --crc-accept=<list>
194              Set a comma‐delimited list of extensions of the  hash  files  to
195              verify.
196
197       --maxdepth=<levels>
198              Descend  at  most  <levels>  (a  non‐negative integer) levels of
199              directories below the command  line  arguments.  `--maxdepth  0'
200              means only apply the tests and actions to the command line argu‐
201              ments.
202
203       -o, --output=<file-path>
204              Set the file to output calculated message digests  or  verifica‐
205              tion results to.
206
207       -l, --log=<file-path>
208              Set the file to log errors and verbose information to.
209
210       --openssl=<list>
211              Specify  which  hash  functions  should  be calculated using the
212              OpenSSL library.  The <list> is a comma delimited list  of  hash
213              function names, but only those supported by openssl are allowed:
214              md4, md5, sha1, sha2*, ripemd160 and whirlpool.
215
216       --gost-reverse
217              Reverse bytes in hexadecimal output of a  GOST  hash  functions.
218              The  most significant byte of the message digest will be printed
219              first.  Default order is the least significant byte first.
220
221       --bt-batch=<file-path>
222              Turn on torrent batch mode (implies  torrent  mode).  Calculates
223              batch-torrent  for the files specified at command line and saves
224              the torrent file to the file-path. The option -r <directory> can
225              be useful in this mode.
226
227       --bt-private
228              Generate BTIH for a private BitTorrent tracker.
229
230       --bt-piece-length
231              Set the piece length value for torrent file.
232
233       --bt-announce=<announce-url>
234              Add a tracker announce URL to the created torrent file(s).  Sev‐
235              eral URLs can be  passed  by  specifying  the  option  mutltiple
236              times.  This option doesn't change the BTIH message digest.
237
238       --benchmark-raw
239              Switch  benchmark  output  format  to be a machine‐readable tab‐
240              delimited text with hash function name, speed,  cpu  clocks  per
241              byte.   This  option  works  only  if the --benchmark option was
242              specified.
243
244       -- (double dash)
245              Mark the end of command line options. All  parameters  following
246              the  double  dash are interpreted as files or directories. It is
247              typically used to process filenames starting with  a  dash  `-'.
248              Alternatively  you  can  specify  './'  or full path before such
249              files, so they will not look like options anymore.
250
251

OUTPUT FORMAT OPTIONS

253       --sfv  Print message digests in the SFV (Simple File Verification) out‐
254              put  format  (default).   But  unlike  common SFV file, not only
255              CRC32, but any message  digests  specified  by  options  can  be
256              printed.
257
258       -g, --magnet
259              Print message digests formatted as magnet links.
260
261       --bsd  Use BSD output format. Each message digest is printed on a sepa‐
262              rate line after hash function name and file's path, enclosed  in
263              parentheses.
264
265       --simple
266              Use simple output format. Each line will consist of filename and
267              message digests specified by options.
268
269       --hex  Print message digests in hexadecimal format.
270
271       --base32
272              Print message digests in Base32 format.
273
274       --base64
275              Print message digests in Base64 format.
276
277       --uppercase
278              Print message digests in upper case.
279
280       --lowercase
281              Print message digests in lower case.
282
283       --template=<file>
284              Read printf‐like template from given <file>.  See  the  --printf
285              option.
286
287       -p, --printf=<format>
288              Format:  print  format  string the standard output, interpreting
289              `\' escapes and `%' directives. The escapes and directives are:
290
291              \n     Newline.
292
293              \r     Carriage return.
294
295              \t     Horizontal tab.
296
297              \\     A literal backslash (`\').
298
299              \0     ASCII NUL.
300
301              \NNN   The character which octal ASCII code is NNN.
302
303              \xNN   The character which hexadecimal ASCII code is NN.
304
305              A `\' character followed by any other character is treated as an
306              ordinary character, so they both are printed.
307
308              %%     A literal percent sign.
309
310              %p     File's path.
311
312              %f     File's name.
313
314              %u or %U
315                     Prefix  used to print a filename, file path or base64/raw
316                     message digest as an  URL‐encoded  string.  For  example:
317                     `%uf',  `%up',  `%uBm', `%u@h'.  Use %u for lowercase and
318                     %U for uppercase characters.
319
320              %s     File's size in bytes.
321
322              %{mtime}
323                     File's last modification time.
324
325              %a or %A
326                     AICH message digest.
327
328              %c or %C
329                     CRC32 checksum.  Use %c for lowercase and %C  for  upper‐
330                     case characters.
331
332              %g or %G
333                     GOST R 34.11-2012 message digest.
334
335              %h or %H
336                     SHA1 message digest.
337
338              %e or %E
339                     ED2K message digest.
340
341              %l or %L
342                     EDonkey ed2k://... link.
343
344              %m or %M
345                     MD5 message digest.
346
347              %r or %R
348                     RIPEMD-160 message digest.
349
350              %t or %T
351                     TTH message digest.
352
353              %w or %W
354                     Whirlpool message digest.
355
356              %{crc32},  %{crc32c}, %{md4}, %{md5}, %{sha1}, %{tiger}, %{tth},
357              %{btih},   %{ed2k},   %{aich},    %{whirlpool},    %{ripemd160},
358              %{has160},    %{gost94},   %{gost94-cryptopro},   %{gost12-256},
359              %{gost12-512}, %{sha-224}, %{sha-256},  %{sha-384},  %{sha-512},
360              %{sha3-224},      %{sha3-256},     %{sha3-384},     %{sha3-512},
361              %{edon-r256}, %{edon-r512}, %{snefru128}, %{snefru256}
362                     Print the specified message  digest.  It  is  printed  in
363                     uppercase,  if the hash function name starts with a capi‐
364                     tal letter, e.g. %{TTH}, %{Sha-512}.
365
366              %x<hash>, %b<hash>, %B<hash>, %@<hash>
367                     Use one of these prefixes to output a message  digest  in
368                     hexadecimal,   base32,  base64  or  raw  (binary)  format
369                     respectively, e.g. %b{md4}, %BH or %xT.
370
371       The default output format can also be changed by renaming  the  program
372       or  placing a hardlink/symlink to it with a filename containing strings
373       `crc32', `crc32c', `md4', `md5', `sha1',  `sha224'  `sha256',  `sha384'
374       `sha512',  `sha3-256',  `sha3-512',  `sha3-224',  `sha3-384',  `tiger',
375       `tth', `btih', `aich', `ed2k', `ed2k-link', `gost12-256', `gost12-512',
376       `gost94',    `gost94-cryptopro',   `rmd160',   `has160',   `whirlpool',
377       `edonr256', `edonr512', `snefru128',  `snefru256',  `sfv'  ,  `bsd'  or
378       `magnet'.
379
380

CONFIG FILE

382       RHash  looks  for  a  config  file  at  $XDG_CONFIG_HOME/rhash/rhashrc,
383       $HOME/.rhashrc and /etc/rhashrc.
384
385       The config file consists of lines formatted as
386              variable = value
387
388       where the variable can be a name of any command line option, like  mag‐
389       net, printf, percents, etc.  A boolean variable can be set to true by a
390       value `on', `yes' or `true', any  other  value  sets  the  variable  to
391       false.
392
393       Empty lines and lines starting with `#' or `;' are ignored.
394
395       Example config file:
396       # This is a comment line
397       percents = on
398       crc-accept = .sfv,.md5,.sha1,.sha256,.sha512,.tth,.magnet
399
400

AUTHOR

402       Aleksey Kravchenko <rhash.admin@gmail.com>
403

SEE ALSO

405       md5sum(1) cksfv(1) ed2k_hash(1)
406

BUGS

408       Bug  reports  are  welcome!   Post  them  to  the  GitHub  issues  page
409       https://github.com/rhash/RHash/issues
410
411
412
413Linux                              APR 2010                           RHASH(1)
Impressum