RHASH(1) User Manuals RHASH(1)

rhash - calculate/check CRC32, MD5, SHA1, GOST, TTH, BTIH or other message digests.

rhash [ option ]... [ file ]...

RHash (Recursive Hasher) computes and verifies various message digests and checksums of files. Supported hash algorithms include CRC32, CRC32C, MD4, MD5, SHA1, SHA256, SHA512, SHA3, Tiger, DC++ TTH, BTIH, AICH, ED2K, GOST R 34.11-*, RIPEMD-160, HAS-160, BLAKE2s/BLAKE2b, EDON-R 256/512, Whirlpool, Snefru-128/256.

The program can create and verify Magnet links and eDonkey ed2k:// links, see --magnet and --ed2k-link options.

A dash string parameter `-' is interpreted as the standard input stream (stdin).

By default rhash prints sums in SFV format with CRC32 checksum only. The format can be changed by options --bsd, --magnet, --simple, --printf, --template. To output all sums use the `-a' option.

The default mode is to print checksums for all files and directory trees specified by command line. The mode can be changed by the following options.

Check hash files specified by command line. RHash can verify hash files in SFV and BSD formats, MD5 and SHA1 files format and text files containing magnet or ed2k links (one link per line). Empty lines and lines starting with `;' or `#' are ignored.

RHash can verify hash files generated without --printf and --template formatting options.

If the hash algorithm is not specified by command line options then RHash tries to detect algorithm from the extension of the hash file. If detection fails, then all hash function of the same hash length are calculated, and that significally slows down files verification. To speed up verification, in such case, explicitly specify the hash algorithm in the command line.

Update the hash file specified by the option. Message digests will be calculated for all files specified by the command line and not present in this hash file. The calculated Message digests will be appended to the updated hash file in the format specified by formatting options. The --update option can be combined with --recursive to update the hash file for whole directory trees. Also --update option can be used with --check to verify the hash file before updating it.
Read the hash file and print missing and inaccessible files, it contains.
Print files that can't be verified by the hash file. That means the files specified by the command line and not present in the hash file. The --unverified option can be used with --recursive to look for unverified files in whole directory trees.
Verify files by crc32 sum embedded in their names.
Create a torrent file for each processed file.
Help: print help screen and exit.
Version: print version and exit.
Run benchmark for the selected hash algorithm(s).

CRC32: Select CRC32 checksum algorithm.
CRC32C: Select CRC32C checksum algorithm.
MD4: Select MD4 hash function.
MD5: Select MD5 hash function.
SHA1: Select SHA1 hash function.
Select specified SHA2 hash function.
Select specified SHA3 hash function.
Tiger: Select Tiger hash function.
TTH: Select DC++ TTH hash function.
BTIH: Select BitTorrent Info Hash.
AICH: Select AICH hash function.
ED2K: Select eDonkey 2000 hash function.
eDonkey link: calculate and print eDonkey link.
Whirlpool: Select Whirlpool hash function.
GOST-2012: Select 256-bit GOST R 34.11-2012, the Russian GOST standard hash function.
GOST-2012: Select 512-bit GOST R 34.11-2012, the Russian GOST standard hash function.
GOST-94: Select GOST R 34.11-94, the deprecated Russian hash function.
--gost94-cryptopro
GOST-94-CRYPTOPRO: Select the CryptoPro version of the deprecated Russian GOST R 34.11-94 hash function.
RIPEMD-160: Select RIPEMD-160 hash function.
HAS-160: Select HAS-160 hash function.
SNEFRU: Select SNEFRU-128/256 hash function.
EDON-R: Select EDON-R 256/512 hash function.
BLAKE2: Select BLAKE2b/BLAKE2s hash function.
Calculate all supported hash functions.
List names of all supported hash functions, one per line.

Recursively process directories, specified by command line.
Follow symbolic links when processing files or directories recursively.
Calculate message digests of the given text message.
Process given file as a file-list. Lines of this file are interpreted as paths to files to be processed. Multiple file lists can be specified at command line.
Be verbose.
Print brief form of verification report (without a header and footer), when verifying a hash file.
Show percents, while calculating or checking sums
Don't print OK messages for successfully verified files.
Ignore missing files, while verifying a hash file.
Ignore case of filenames when updating crc files.
Print per-file and the total processing speed.
Rename files by inserting crc32 sum into name.
Insert specified <delimiter> before a crc sum in the --embed-crc mode, default is white space. The <delimiter> can be a character or empty string.
Use specified path separator to display paths. Only slash (`/') and backslash (`\') values are accepted.
Set a comma‐delimited list of extensions of the files to process.
Set a comma‐delimited list of extensions of the files to exclude from processing.
Set a comma‐delimited list of extensions of the hash files to verify.
Descend at most <levels> (a non‐negative integer) levels of directories below the command line arguments. `--max-depth 0' means only apply the tests and actions to the command line arguments.
Set the file to output calculated message digests or verification results to.
Set the file to log errors and verbose information to.
Specify which hash functions should be calculated using the OpenSSL library. The <list> is a comma delimited list of hash function names, but only those supported by openssl are allowed: md4, md5, sha1, sha2*, ripemd160 and whirlpool.
Reverse bytes in hexadecimal output of a GOST hash functions. The most significant byte of the message digest will be printed first. Default order is the least significant byte first.
Turn on torrent batch mode (implies torrent mode). Calculates batch-torrent for the files specified at command line and saves the torrent file to the file-path. The option -r <directory> can be useful in this mode.
Generate torrent file or BTIH for a private BitTorrent tracker.
Generate torrent file or BTIH compatible with Transmission torrent client.
Set the piece length value for torrent file.
Add a tracker announce URL to the created torrent file(s). Several URLs can be passed by specifying the option mutltiple times. This option doesn't change the BTIH message digest.
Switch benchmark output format to be a machine‐readable tab‐delimited text with hash function name, speed, cpu clocks per byte. This option works only if the --benchmark option was specified.
Do not detect hash function by an extension of hash file, in the --check mode.
Turn off escape characters in file paths. The option can be specified in the default, check or update modes.
-- (double dash)
Mark the end of command line options. All parameters following the double dash are interpreted as files or directories. It is typically used to process filenames starting with a dash `-'. Alternatively you can specify './' or full path before such files, so they will not look like options anymore.

Print message digests in the SFV (Simple File Verification) output format (default). But unlike common SFV file, not only CRC32, but any message digests specified by options can be printed.
Print message digests formatted as magnet links.
Use BSD output format. Each message digest is printed on a separate line after hash function name and file's path, enclosed in parentheses.
Use simple output format. Each line will consist of filename and message digests specified by options.
Print message digests in hexadecimal format.
Print message digests in Base32 format.
Print message digests in Base64 format.
Print message digests in upper case.
Print message digests in lower case.
Read printf‐like template from given <file>. See the --printf option.
Format: print format string the standard output, interpreting `\' escapes and `%' directives. The escapes and directives are:
Newline.
Carriage return.
Horizontal tab.
\\
A literal backslash (`\').
\0
ASCII NUL.
The character which octal ASCII code is NNN.
The character which hexadecimal ASCII code is NN.

A `\' character followed by any other character is treated as an ordinary character, so they both are printed.

%%
A literal percent sign.
%p
File's path.
%f
File's name.
%d
File's directory.
%u or %U
Prefix used to print a filename, file path or base64/raw message digest as an URL‐encoded string. For example: `%up', `%ud', `%uf', `%uBm', `%u@h'. Use %u for lowercase and %U for uppercase hexadecimal characters.
%s
File's size in bytes.
%{mtime}
File's last modification time.
%a or %A
AICH message digest.
%c or %C
CRC32 checksum. Use %c for lowercase and %C for uppercase characters.
%g or %G
GOST R 34.11-2012 256-bit message digest.
%h or %H
SHA1 message digest.
%e or %E
ED2K message digest.
%l or %L
EDonkey ed2k://... link.
%m or %M
MD5 message digest.
%r or %R
RIPEMD-160 message digest.
%t or %T
TTH message digest.
%w or %W
Whirlpool message digest.
%{crc32}, %{crc32c}, %{md4}, %{md5}, %{sha1}, %{tiger}, %{tth}, %{btih}, %{ed2k}, %{aich}, %{whirlpool}, %{ripemd160}, %{has160}, %{gost94}, %{gost94-cryptopro}, %{gost12-256}, %{gost12-512}, %{sha-224}, %{sha-256}, %{sha-384}, %{sha-512}, %{sha3-224}, %{sha3-256}, %{sha3-384}, %{sha3-512}, %{edon-r256}, %{edon-r512}, %{blake2s}, %{blake2b}, %{snefru128}, %{snefru256}
Print the specified message digest. It is printed in uppercase, if the hash function name starts with a capital letter, e.g. %{TTH}, %{Sha-512}.
%x<hash>, %b<hash>, %B<hash>, %@<hash>
Use one of these prefixes to output a message digest in hexadecimal, base32, base64 or raw (binary) format respectively, e.g. %b{md4}, %BH or %xT.

The default output format can also be changed by renaming the program or placing a hardlink/symlink to it with a filename containing strings `crc32', `crc32c', `md4', `md5', `sha1', `sha224' `sha256', `sha384' `sha512', `sha3-256', `sha3-512', `sha3-224', `sha3-384', `tiger', `tth', `btih', `aich', `ed2k', `ed2k-link', `gost12-256', `gost12-512', `gost94', `gost94-cryptopro', `rmd160', `has160', `whirlpool', `edonr256', `edonr512', `blake2s', `blake2b', `snefru128', `snefru256', `sfv' , `bsd' or `magnet'.

RHash looks for a config file at $XDG_CONFIG_HOME/rhash/rhashrc, $HOME/.config/rhash/rhashrc, $XDG_CONFIG_DIRS/rhash/rhashrc, $HOME/.rhashrc and /etc/rhashrc.

The config file consists of lines formatted as

variable = value

where the variable can be a name of any command line option, like magnet, printf, percents, etc. A boolean variable can be set to true by a value `on', `yes' or `true', any other value sets the variable to false.

Empty lines and lines starting with `#' or `;' are ignored.

Example config file:

# This is a comment line
percents = on
crc-accept = .sfv,.md5,.sha1,.sha256,.sha512,.tth,.magnet

Aleksey Kravchenko <rhash.admin@gmail.com>

md5sum(1) cksfv(1) ed2k_hash(1)

Bug reports are welcome! Post them to the GitHub issues page https://github.com/rhash/RHash/issues

APR 2010 Linux