1RHASH(1) User Manuals RHASH(1)
2
3
4
6 rhash - calculate/check CRC32, MD5, SHA1, GOST, TTH, BTIH or other mes‐
7 sage digests.
8
10 rhash [ option ]... [ file ]...
11
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
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. Message digests
53 will be calculated for all files specified by the command line
54 and not present in this hash file. The calculated Message di‐
55 gests will be appended to the updated hash file in the format
56 specified by formatting options. The --update option can be
57 combined with --recursive to update a hash file for whole direc‐
58 tory trees. Also --update option can be used with --check to
59 verify the hash file before updating it.
60
61 -k, --check-embedded
62 Verify files by crc32 sum embedded in their names.
63
64 --torrent
65 Create a torrent file for each processed file.
66
67 -h, --help
68 Help: print help screen and exit.
69
70 -V, --version
71 Version: print version and exit.
72
73 -B, --benchmark
74 Run benchmark for the selected hash algorithm(s).
75
76
78 -C, --crc32
79 CRC32: Select CRC32 checksum algorithm.
80
81 --crc32c
82 CRC32C: Select CRC32C checksum algorithm.
83
84 --md4 MD4: Select MD4 hash function.
85
86 -M, --md5
87 MD5: Select MD5 hash function.
88
89 -H, --sha1
90 SHA1: Select SHA1 hash function.
91
92 --sha224, --sha256, --sha384, --sha512
93 Select specified SHA2 hash function.
94
95 --sha3-224, --sha3-256, --sha3-384, --sha3-512
96 Select specified SHA3 hash function.
97
98 --tiger
99 Tiger: Select Tiger hash function.
100
101 -T, --tth
102 TTH: Select DC++ TTH hash function.
103
104 --btih BTIH: Select BitTorrent Info Hash.
105
106 -A, --aich
107 AICH: Select AICH hash function.
108
109 -E, --ed2k
110 ED2K: Select eDonkey 2000 hash function.
111
112 -L, --ed2k-link
113 eDonkey link: calculate and print eDonkey link.
114
115 -W, --whirlpool
116 Whirlpool: Select Whirlpool hash function.
117
118 -G, --gost12-256
119 GOST-2012: Select 256-bit GOST R 34.11-2012, the Russian GOST
120 standard hash function.
121
122 --gost12-512
123 GOST-2012: Select 512-bit GOST R 34.11-2012, the Russian GOST
124 standard hash function.
125
126 --gost94
127 GOST-94: Select GOST R 34.11-94, the deprecated Russian hash
128 function.
129
130 --gost94-cryptopro
131 GOST-94-CRYPTOPRO: Select the CryptoPro version of the depre‐
132 cated Russian GOST R 34.11-94 hash function.
133
134 --ripemd160
135 RIPEMD-160: Select RIPEMD-160 hash function.
136
137 --has160
138 HAS-160: Select HAS-160 hash function.
139
140 --snefru128, --snefru256
141 SNEFRU: Select SNEFRU-128/256 hash function.
142
143 --edonr256, --edonr512
144 EDON-R: Select EDON-R 256/512 hash function.
145
146 --blake2b, --blake2s
147 BLAKE2: Select BLAKE2b/BLAKE2s hash function.
148
149
150 -a, --all
151 Calculate all supported hash functions.
152
153 --list-hashes
154 List names of all supported hash functions, one per line.
155
156
158 -r, --recursive
159 Recursively process directories, specified by command line.
160
161 --follow
162 Follow symbolic links when processing files or directories re‐
163 cursively.
164
165 -m, --message=<text>
166 Calculate message digests of the given text message.
167
168 --file-list=<file>
169 Process given file as a file-list. Lines of this file are inter‐
170 preted as paths to files to be processed. Multiple file lists
171 can be specified at command line.
172
173 -v, --verbose
174 Be verbose.
175
176 --brief
177 Print brief form of verification report (without a header and
178 footer), when verifying a hash file.
179
180 -P, --percents
181 Show percents, while calculating or checking sums
182
183 --skip-ok
184 Don't print OK messages for successfully verified files.
185
186 -i, --ignore-missing
187 Ignore missing files, while verifying a hash file.
188
189 -i, --ignore-case
190 Ignore case of filenames when updating crc files.
191
192 --speed
193 Print per-file and the total processing speed.
194
195 -e, --embed-crc
196 Rename files by inserting crc32 sum into name.
197
198 --embed-crc-delimiter=<delimiter>
199 Insert specified <delimiter> before a crc sum in the --embed-crc
200 mode, default is white space. The <delimiter> can be a character
201 or empty string.
202
203 --path-separator=<separator>
204 Use specified path separator to display paths.
205
206 -q, --accept=<list>
207 Set a comma‐delimited list of extensions of the files to
208 process.
209
210 --exclude=<list>
211 Set a comma‐delimited list of extensions of the files to exclude
212 from processing.
213
214 -t, --crc-accept=<list>
215 Set a comma‐delimited list of extensions of the hash files to
216 verify.
217
218 --maxdepth=<levels>
219 Descend at most <levels> (a non‐negative integer) levels of di‐
220 rectories below the command line arguments. `--maxdepth 0' means
221 only apply the tests and actions to the command line arguments.
222
223 -o, --output=<file-path>
224 Set the file to output calculated message digests or verifica‐
225 tion results to.
226
227 -l, --log=<file-path>
228 Set the file to log errors and verbose information to.
229
230 --openssl=<list>
231 Specify which hash functions should be calculated using the
232 OpenSSL library. The <list> is a comma delimited list of hash
233 function names, but only those supported by openssl are allowed:
234 md4, md5, sha1, sha2*, ripemd160 and whirlpool.
235
236 --gost-reverse
237 Reverse bytes in hexadecimal output of a GOST hash functions.
238 The most significant byte of the message digest will be printed
239 first. Default order is the least significant byte first.
240
241 --bt-batch=<file-path>
242 Turn on torrent batch mode (implies torrent mode). Calculates
243 batch-torrent for the files specified at command line and saves
244 the torrent file to the file-path. The option -r <directory> can
245 be useful in this mode.
246
247 --bt-private
248 Generate torrent file or BTIH for a private BitTorrent tracker.
249
250 --bt-transmission
251 Generate torrent file or BTIH compatible with Transmission tor‐
252 rent client.
253
254 --bt-piece-length
255 Set the piece length value for torrent file.
256
257 --bt-announce=<announce-url>
258 Add a tracker announce URL to the created torrent file(s). Sev‐
259 eral URLs can be passed by specifying the option mutltiple
260 times. This option doesn't change the BTIH message digest.
261
262 --benchmark-raw
263 Switch benchmark output format to be a machine‐readable tab‐de‐
264 limited text with hash function name, speed, cpu clocks per
265 byte. This option works only if the --benchmark option was
266 specified.
267
268 --no-detect-by-ext
269 Do not detect hash function by an extension of hash file, in the
270 --check mode.
271
272 --no-path-escaping
273 Turn off escape characters in file paths. The option can be
274 specified in the default, check or update modes.
275
276 -- (double dash)
277 Mark the end of command line options. All parameters following
278 the double dash are interpreted as files or directories. It is
279 typically used to process filenames starting with a dash `-'.
280 Alternatively you can specify './' or full path before such
281 files, so they will not look like options anymore.
282
283
285 --sfv Print message digests in the SFV (Simple File Verification) out‐
286 put format (default). But unlike common SFV file, not only
287 CRC32, but any message digests specified by options can be
288 printed.
289
290 -g, --magnet
291 Print message digests formatted as magnet links.
292
293 --bsd Use BSD output format. Each message digest is printed on a sepa‐
294 rate line after hash function name and file's path, enclosed in
295 parentheses.
296
297 --simple
298 Use simple output format. Each line will consist of filename and
299 message digests specified by options.
300
301 --hex Print message digests in hexadecimal format.
302
303 --base32
304 Print message digests in Base32 format.
305
306 -b, --base64
307 Print message digests in Base64 format.
308
309 --uppercase
310 Print message digests in upper case.
311
312 --lowercase
313 Print message digests in lower case.
314
315 --template=<file>
316 Read printf‐like template from given <file>. See the --printf
317 option.
318
319 -p, --printf=<format>
320 Format: print format string the standard output, interpreting
321 `\' escapes and `%' directives. The escapes and directives are:
322
323 \n Newline.
324
325 \r Carriage return.
326
327 \t Horizontal tab.
328
329 \\ A literal backslash (`\').
330
331 \0 ASCII NUL.
332
333 \NNN The character which octal ASCII code is NNN.
334
335 \xNN The character which hexadecimal ASCII code is NN.
336
337 A `\' character followed by any other character is treated as an
338 ordinary character, so they both are printed.
339
340 %% A literal percent sign.
341
342 %p File's path.
343
344 %f File's name.
345
346 %u or %U
347 Prefix used to print a filename, file path or base64/raw
348 message digest as an URL‐encoded string. For example:
349 `%uf', `%up', `%uBm', `%u@h'. Use %u for lowercase and
350 %U for uppercase characters.
351
352 %s File's size in bytes.
353
354 %{mtime}
355 File's last modification time.
356
357 %a or %A
358 AICH message digest.
359
360 %c or %C
361 CRC32 checksum. Use %c for lowercase and %C for upper‐
362 case characters.
363
364 %g or %G
365 GOST R 34.11-2012 256-bit message digest.
366
367 %h or %H
368 SHA1 message digest.
369
370 %e or %E
371 ED2K message digest.
372
373 %l or %L
374 EDonkey ed2k://... link.
375
376 %m or %M
377 MD5 message digest.
378
379 %r or %R
380 RIPEMD-160 message digest.
381
382 %t or %T
383 TTH message digest.
384
385 %w or %W
386 Whirlpool message digest.
387
388 %{crc32}, %{crc32c}, %{md4}, %{md5}, %{sha1}, %{tiger}, %{tth},
389 %{btih}, %{ed2k}, %{aich}, %{whirlpool}, %{ripemd160},
390 %{has160}, %{gost94}, %{gost94-cryptopro}, %{gost12-256},
391 %{gost12-512}, %{sha-224}, %{sha-256}, %{sha-384}, %{sha-512},
392 %{sha3-224}, %{sha3-256}, %{sha3-384}, %{sha3-512},
393 %{edon-r256}, %{edon-r512}, %{blake2s}, %{blake2b}, %{sne‐
394 fru128}, %{snefru256}
395 Print the specified message digest. It is printed in up‐
396 percase, if the hash function name starts with a capital
397 letter, e.g. %{TTH}, %{Sha-512}.
398
399 %x<hash>, %b<hash>, %B<hash>, %@<hash>
400 Use one of these prefixes to output a message digest in
401 hexadecimal, base32, base64 or raw (binary) format re‐
402 spectively, e.g. %b{md4}, %BH or %xT.
403
404 The default output format can also be changed by renaming the program
405 or placing a hardlink/symlink to it with a filename containing strings
406 `crc32', `crc32c', `md4', `md5', `sha1', `sha224' `sha256', `sha384'
407 `sha512', `sha3-256', `sha3-512', `sha3-224', `sha3-384', `tiger',
408 `tth', `btih', `aich', `ed2k', `ed2k-link', `gost12-256', `gost12-512',
409 `gost94', `gost94-cryptopro', `rmd160', `has160', `whirlpool',
410 `edonr256', `edonr512', `blake2s', `blake2b', `snefru128', `snefru256',
411 `sfv' , `bsd' or `magnet'.
412
413
415 RHash looks for a config file at $XDG_CONFIG_HOME/rhash/rhashrc,
416 $HOME/.config/rhash/rhashrc, $XDG_CONFIG_DIRS/rhash/rhashrc,
417 $HOME/.rhashrc and /etc/rhashrc.
418
419 The config file consists of lines formatted as
420 variable = value
421
422 where the variable can be a name of any command line option, like mag‐
423 net, printf, percents, etc. A boolean variable can be set to true by a
424 value `on', `yes' or `true', any other value sets the variable to
425 false.
426
427 Empty lines and lines starting with `#' or `;' are ignored.
428
429 Example config file:
430 # This is a comment line
431 percents = on
432 crc-accept = .sfv,.md5,.sha1,.sha256,.sha512,.tth,.magnet
433
434
436 Aleksey Kravchenko <rhash.admin@gmail.com>
437
439 md5sum(1) cksfv(1) ed2k_hash(1)
440
442 Bug reports are welcome! Post them to the GitHub issues page
443 https://github.com/rhash/RHash/issues
444
445
446
447Linux APR 2010 RHASH(1)