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

NAME

6       rhash - calculate/check CRC32, MD5, SHA1, GOST, TTH, BTIH or other hash
7       sums.
8

SYNOPSIS

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

DESCRIPTION

13       RHash (Recursive Hasher) computes and verifies various message  digests
14       (hash  sums)  of  files.  Supported message digests include CRC32, MD4,
15       MD5, SHA1, SHA256, SHA512, SHA3,  Tiger,  DC++  TTH,  BitTorrent  BTIH,
16       AICH,  ED2K,  GOST  R  34.11-94,  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 stdin file.
23
24       By  default  rhash  prints sums in SFV format with CRC32 hash sum only.
25       The format  can  be  changed  by  options  --bsd,  --magnet,  --simple,
26       --printf, --template.  To output all sums use the `-a' option.
27
28       The  default  output format can also be changed by renaming the program
29       or placing a hardlink/symlink to it  with  a  name  containing  strings
30       `crc32',  `md4',  `md5',  `sha1',  `sha256'  `sha512',  `tiger', `tth',
31       `btih',  `aich',   `ed2k',   `ed2k-link',   `gost',   `gost-cryptopro',
32       `ripemd160',   `has160',  `whirlpool',  `edonr256',  `edonr512',  `sne‐
33       fru128', `snefru256', `sfv' or `magnet'.
34
35

PROGRAM MODE OPTIONS

37       The default mode is to print hash sums  for  all  files  and  directory
38       trees  specified  by command line. The mode can be set by the following
39       options.
40
41       -c, --check
42              Check hash files specified by command  line.  RHash  can  verify
43              hash  files in SFV and BSD formats, standard MD5 and SHA1 files,
44              and text files containing magnet or ed2k  links  (one  link  per
45              line).   Empty  lines  and  lines  starting  with `;' or `#' are
46              skipped.  In fact RHash can verify most hash files generated  by
47              itself without formating options --printf and --template.
48
49       -u, --update
50              Update hash files specified by command line.  The program calcu‐
51              lates and appends hashes to the updated hash file in the  format
52              specified by formating options.  Hashes are calculated for those
53              files from the same directory as the hash file,  which  are  yet
54              not present in it.
55
56       -k, --check-embedded
57              Verify files by crc32 sum embedded in their names.
58
59       --torrent
60              Create a torrent file for each processed file.
61
62       -h, --help
63              Help: print help screen and exit.
64
65       -V, --version
66              Version: print version and exit.
67
68       -B, --benchmark
69              Run benchmark for selected algorithm(s).
70
71

HASH SUMS OPTIONS

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

MISCELLANEOUS OPTIONS

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

OUTPUT FORMAT OPTIONS

237       --sfv  Print hash sums in the SFV  (Simple  File  Verification)  output
238              format  (default).   But unlike common SFV file, not only CRC32,
239              but any hash sums specified by options can be printed.
240
241       -m, --magnet
242              Print hash sums formatted as magnet links.
243
244       --bsd  Use BSD output format. Each hash sum is printed on separate line
245              after hash name and file's path, enclosed in parentheses.
246
247       --simple
248              Use simple output format. Each line will consist of filename and
249              hash sums specified by options.
250
251       --uppercase
252              Print hash sums in upper case.
253
254       --lowercase
255              Print hash sums in lower case.
256
257       --template=<file>
258              Read printf‐like template from given <file>.  See  the  --printf
259              option.
260
261       -p, --printf=<format>
262              Format:  print  format  string the standard output, interpreting
263              `\' escapes and `%' directives. The escapes and directives are:
264
265              \n     Newline.
266
267              \r     Carriage return.
268
269              \t     Horizontal tab.
270
271              \\     A literal backslash (`\').
272
273              \0     ASCII NUL.
274
275              \NNN   The character which octal ASCII code is NNN.
276
277              \xNN   The character which hexadecimal ASCII code is NN.
278
279              A `\' character followed by any other character is treated as an
280              ordinary character, so they both are printed.
281
282              %%     A literal percent sign.
283
284              %p     File's path.
285
286              %f     File's name.
287
288              %u     URL‐encoded filename.
289
290              %s     File's size in bytes.
291
292              %{mtime}
293                     File's last modification time.
294
295              %a or %A
296                     AICH hash sum.
297
298              %c or %C
299                     CRC32  hash  sum.  Use %c for lowercase and %C for upper‐
300                     case characters.
301
302              %g or %G
303                     GOST R 34.11-94 hash.
304
305              %h or %H
306                     SHA1 hash.
307
308              %e or %E
309                     ED2K hash sum.
310
311              %l or %L
312                     EDonkey ed2k://... link.
313
314              %m or %M
315                     MD5 hash.
316
317              %r or %R
318                     RIPEMD-160 hash.
319
320              %t or %T
321                     TTH sum.
322
323              %w or %W
324                     Whirlpool hash.
325
326              %{md4},   %{sha-224},   %{sha-256},   %{sha-384},    %{sha-512},
327              %{sha3-224},  %{sha3-256},  %{sha3-384},  %{sha3-512}  %{tiger},
328              %{btih},  %{gost-cryptopro},  %{has160},  %{snefru128},   %{sne‐
329              fru256}, %{edon-r256}, %{edon-r512}
330                     Print  specified  hash  sum.  Actually  the %{<hash sum>}
331                     directive can print any supported hash sum. If a hash sum
332                     name  starts  with  a  capital  letter  then  the hash is
333                     printed in uppercase, e.g. %{TTH}, %{Sha-512}.
334
335              %x<hash>, %b<hash>, %B<hash>, %@<hash>
336                     Use one of these prefixes to output a hash sum  in  hexa‐
337                     decimal,  base32,  base64  or raw (binary) format respec‐
338                     tively, e.g. %b{md4}, %BH or %xT.
339
340

CONFIG FILE

342       RHash looks for a config file at $HOME/.rhashrc and /etc/rhashrc.
343
344       The config file consists of lines formatted as
345              variable = value
346
347       where the variable can be a name of any command line option, like  mag‐
348       net, printf, percents, etc.  A boolean variable can be set to true by a
349       value `on', `yes' or `true', any  other  value  sets  the  variable  to
350       false.
351
352       Empty lines and lines starting with `#' or `;' are ignored.
353
354       Example config file:
355       # This is a comment line
356       percents = on
357       crc-accept = .sfv,.md5,.sha1,.sha256,.sha512,.tth,.magnet
358
359

AUTHOR

361       Aleksey Kravchenko <rhash.admin@gmail.com>
362

SEE ALSO

364       md5sum(1) cksfv(1) ed2k_hash(1)
365

BUGS

367       Bug reports are welcome!  Send them by email or post to the SourceForge
368       Bug Tracking System http://sourceforge.net/projects/rhash/
369
370
371
372Linux                              APR 2010                           RHASH(1)
Impressum