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, BLAKE2s/BLAKE2b,
17       EDON-R 256/512, 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, MD5 and SHA1 files format and
38              text files containing magnet or ed2k links (one link per  line).
39              Empty lines and lines starting with `;' or `#' are ignored.
40
41              RHash  can  verify  hash  files  generated  without --printf and
42              --template formatting options.
43
44              If the hash algorithm is not specified by command  line  options
45              then  RHash  tries to detect algorithm from the extension of the
46              hash file.  If detection fails, then all hash  function  of  the
47              same  hash  length  are  calculated, and that significally slows
48              down files verification. To speed up verification, in such case,
49              explicitly specify the hash algorithm in the command line.
50
51       -u, --update=<hash-file>
52              Update the hash file specified by the option.  Checksums will be
53              calculated for all files specified by command and not present in
54              this hash file. The calculated checksums will be appended to the
55              updated hash file in the format specified by formatting options.
56              This  option  can be combined with --recursive, to update a hash
57              file for whole directory trees.
58
59       -k, --check-embedded
60              Verify files by crc32 sum embedded in their names.
61
62       --torrent
63              Create a torrent file for each processed file.
64
65       -h, --help
66              Help: print help screen and exit.
67
68       -V, --version
69              Version: print version and exit.
70
71       -B, --benchmark
72              Run benchmark for the selected hash algorithm(s).
73
74

HASH ALGORITHMS OPTIONS

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

MISCELLANEOUS OPTIONS

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

OUTPUT FORMAT OPTIONS

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

CONFIG FILE

398       RHash  looks  for  a  config  file  at  $XDG_CONFIG_HOME/rhash/rhashrc,
399       $HOME/.config/rhash/rhashrc,            $XDG_CONFIG_DIRS/rhash/rhashrc,
400       $HOME/.rhashrc and /etc/rhashrc.
401
402       The config file consists of lines formatted as
403              variable = value
404
405       where  the variable can be a name of any command line option, like mag‐
406       net, printf, percents, etc.  A boolean variable can be set to true by a
407       value  `on',  `yes'  or  `true',  any  other value sets the variable to
408       false.
409
410       Empty lines and lines starting with `#' or `;' are ignored.
411
412       Example config file:
413       # This is a comment line
414       percents = on
415       crc-accept = .sfv,.md5,.sha1,.sha256,.sha512,.tth,.magnet
416
417

AUTHOR

419       Aleksey Kravchenko <rhash.admin@gmail.com>
420

SEE ALSO

422       md5sum(1) cksfv(1) ed2k_hash(1)
423

BUGS

425       Bug  reports  are  welcome!   Post  them  to  the  GitHub  issues  page
426       https://github.com/rhash/RHash/issues
427
428
429
430Linux                              APR 2010                           RHASH(1)
Impressum