Artifact Content
Not logged in

Artifact 00b5e676744866f7ab9df6142c0d64c6c8892279:

.TH RHASH 1 "APR 2010" Linux "User Manuals"
rhash \- calculate/check CRC32, MD5, SHA1, GOST, TTH, BTIH or other hash sums.
.B rhash [
.I option
.B ]... [
.I file
.B ]...
.B RHash
(Recursive Hasher)
computes and verifies various message digests (hash sums) of files.
Supported message digests include CRC32, MD4, MD5, SHA1, SHA256, SHA512,
SHA3, Tiger, DC++ TTH, BitTorrent BTIH, AICH, ED2K, GOST R 34.11\-94,
RIPEMD\-160, HAS\-160, 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 stdin file.

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

The default output format can also be changed by renaming the program or
placing a hardlink/symlink to it with a name containing strings `crc32',
`md4', `md5', `sha1', `sha256' `sha512', `tiger', `tth', `btih', `aich',
`ed2k', `ed2k\-link', `gost', `gost\-cryptopro', `ripemd160', `has160',
`whirlpool', `edonr256', `edonr512', `snefru128', `snefru256',
`sfv' or `magnet'.

The default mode is to print hash sums for all files and directory trees
specified by command line. The mode can be set by the following options.
.IP "\-c, \-\-check"
Check hash files specified by command line. RHash can verify hash files in
SFV and BSD formats, standard MD5 and SHA1 files,
and text files containing magnet or ed2k links (one link per line).
Empty lines and lines starting with `;' or `#' are skipped.
In fact RHash can verify most hash files generated by itself
without formatting options \-\-printf and \-\-template.
.IP "\-u, \-\-update"
Update hash files specified by command line.
The program calculates and appends hashes to the updated hash file
in the format specified by formatting options.
Hashes are calculated for those files from the same directory
as the hash file, which are yet not present in it.
.IP "\-k, \-\-check\-embedded"
Verify files by crc32 sum embedded in their names.
.IP "\-\-torrent"
Create a torrent file for each processed file.
.IP "\-h, \-\-help"
Help: print help screen and exit.
.IP "\-V, \-\-version"
Version: print version and exit.
.IP "\-B, \-\-benchmark"
Run benchmark for selected algorithm(s).

.IP "\-C, \-\-crc32"
CRC32: calculate and print CRC32 hash sum.
.IP "\-\-md4"
MD4: calculate and print MD4 hash sum.
.IP "\-M, \-\-md5"
MD5: calculate and print MD5 hash sum.
.IP "\-H, \-\-sha1"
SHA1: calculate and print SHA1 hash sum.
.IP "\-\-sha224, \-\-sha256, \-\-sha384, \-\-sha512"
Calculate specified SHA2 hash sum.
.IP "\-\-sha3-224, \-\-sha3-256, \-\-sha3-384, \-\-sha3-512"
Calculate specified SHA3 hash sum.
.IP "\-\-tiger"
Tiger: calculate and print Tiger hash sum.
.IP "\-T, \-\-tth"
TTH: calculate and print DC++ TTH sum.
.IP "\-\-btih"
BTIH: calculate and print BitTorrent Info Hash.
.IP "\-A, \-\-aich"
AICH: calculate and print AICH hash.
.IP "\-E, \-\-ed2k"
ED2K: calculate and print eDonkey 2000 hash sum.
.IP "\-L, \-\-ed2k\-link"
eDonkey link: calculate and print eDonkey link.
.IP "\-W, \-\-whirlpool"
Whirlpool: calculate and print Whirlpool hash sum.
.IP "\-G, \-\-gost"
GOST: calculate and print GOST R 34.11\-94 hash, 
the Russian GOST standard hash function.
.IP "\-\-gost\-cryptopro"
GOST\-CRYPTOPRO: calculate and print CryptoPro version of
the GOST R 34.11\-94 hash function.
.IP "\-\-ripemd160"
RIPEMD\-160: calculate and print RIPEMD\-160 hash sum.
.IP "\-\-has160"
HAS\-160: calculate and print HAS\-160 hash sum.
.IP "\-\-snefru128, \-\-snefru256"
SNEFRU: calculate and print SNEFRU\-128/256 hash sums.
.IP "\-\-edonr256, \-\-edonr512"
EDON\-R: calculate and print EDON\-R 256/512 hash sums.

.IP "\-a, \-\-all"
Calculate all supported hash sums.
.IP "\-\-list\-hashes"
List names of all supported hashes, one per line.

.IP "\-r, \-\-recursive"
Recursively process directories, specified by command line.
.IP "\-\-file\-list=<file>"
Process a file-list. File-list is a text file, containing paths to files,
one path per line.
.IP "\-\-follow"
Follow symbolic links when processing directories recursively.
.IP "\-v, \-\-verbose"
Be verbose.
.IP "\-\-percents"
Show percents, while calculating or checking sums
.IP "\-\-skip\-ok"
Don't print OK messages for successfully verified files.
.IP "\-i, \-\-ignore\-case"
Ignore case of filenames when updating crc files.
.IP "\-\-speed"
Print per\-file and the total processing speed.
.IP "\-e, \-\-embed\-crc"
Rename files by inserting crc32 sum into name.
.IP "\-\-embed\-crc\-delimiter=<delimiter>"
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.
.IP "\-\-path\-separator=<separator>"
Use specified path separator to display paths.
.IP "\-q, \-\-accept=<list>"
Set a comma\(hydelimited list of extensions of the files to process.
.IP "\-\-exclude=<list>"
Set a comma\(hydelimited list of extensions of the files to exclude from processing.
.IP "\-t, \-\-crc\-accept=<list>"
Set a comma\(hydelimited list of extensions of the hash files to verify.
.IP "\-\-maxdepth=<levels>"
Descend at most <levels> (a non\(hynegative integer) levels of directories below 
the command line arguments. `\-\-maxdepth 0' means only apply the tests and 
actions to the command line arguments.
.IP "\-o, \-\-output=<file\-path>"
Set the file to output calculated hashes and verification results to.
.IP "\-l, \-\-log=<file\-path>"
Set the file to log errors and verbose information to.
.IP "\-\-openssl=<list>"
Specify which hash functions should be calculated using the OpenSSL library.
The <list> is a comma delimited list of hash names, but only those
supported by openssl are allowed, e.g. md4, md5, sha1, sha256, ripemd160.
See openssl documentation for the full list.
.IP "\-\-gost\-reverse"
Reverse bytes in hexadecimal output of the GOST hash sum.
The most significant bytes of the hash will be printed first.
Default order is the least significant bytes first.
.IP "\-\-bt\-batch=<file\-path>"
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.
.IP "\-\-bt\-private"
Generate BTIH for a private BitTorrent tracker.
.IP "\-\-bt\-piece\-length"
Set the 
.I "piece length"
value for torrent file.
.IP "\-\-bt\-announce=<announce\-url>"
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 hash.
.IP "\-\-benchmark\-raw"
Switch benchmark output format to be a machine\(hyreadable tab\(hydelimited text
with hash function name, speed, cpu clocks per byte.
This option works only if the \-\-benchmark option was specified.
.IP "\-\- (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.

.IP "\-\-sfv"
Print hash sums in the SFV (Simple File Verification) output format (default). 
But unlike common SFV file, not only CRC32, but any hash sums specified
by options can be printed.
.IP "\-m, \-\-magnet"
Print hash sums formatted as magnet links.
.IP "\-\-bsd"
Use BSD output format. Each hash sum is printed on separate line
after hash name and file's path, enclosed in parentheses.
.IP "\-\-simple"
Use simple output format. Each line will consist of
filename and hash sums specified by options.
.IP "\-\-uppercase"
Print hash sums in upper case.
.IP "\-\-lowercase"
Print hash sums in lower case.
.IP "\-\-template=<file>"
Read printf\(hylike template from given <file>. See the \-\-printf option.
.IP "\-p, \-\-printf=<format>"
Format: print 
.I format
string the standard output, interpreting `\e' 
escapes and `%' directives. The escapes and directives are: 
.IP \en
.IP \er
Carriage return.
.IP \et
Horizontal tab.
.IP \e\e
A literal backslash (`\e').
.IP \e0
The character which octal ASCII code is NNN.
.IP \exNN
The character which hexadecimal ASCII code is NN.
A `\e' character followed by any other character is treated as an
ordinary character, so they both are printed.
.IP %%
A literal percent sign.
.IP %p
File's path.
.IP %f
File's name.
.IP %u
URL\(hyencoded filename.
.IP %s
File's size in bytes.
.IP %{mtime}
File's last modification time.
.IP "%a or %A"
AICH hash sum. 
.IP "%c or %C"
CRC32 hash sum. 
Use %c for lowercase and %C for uppercase characters.
.IP "%g or %G"
GOST R 34.11\-94 hash.
.IP "%h or %H"
SHA1 hash.
.IP "%e or %E"
ED2K hash sum.
.IP "%l or %L"
EDonkey ed2k://... link.
.IP "%m or %M"
MD5 hash.
.IP "%r or %R"
RIPEMD-160 hash.
.IP "%t or %T"
TTH sum.
.IP "%w or %W"
Whirlpool hash.
.IP "%{md4}, %{sha-224}, %{sha-256}, %{sha-384}, %{sha-512}, %{sha3-224},\
 %{sha3-256}, %{sha3-384}, %{sha3-512} %{tiger}, %{btih}, %{gost\-cryptopro},\
 %{has160}, %{snefru128}, %{snefru256}, %{edon\-r256}, %{edon\-r512}"
Print specified hash sum. Actually the %{<hash sum>} directive can print any
supported hash sum. If a hash sum name starts with a capital letter then the
hash is printed in uppercase, e.g. %{TTH}, %{Sha-512}.
.IP "%x<hash>, %b<hash>, %B<hash>, %@<hash>"
Use one of these prefixes to output a hash sum in hexadecimal, base32,
base64 or raw (binary) format respectively, e.g. %b{md4}, %BH or %xT.

RHash looks for a config file
at $HOME/.rhashrc and /etc/rhashrc.

The config file consists of lines formatted as
variable = value

where the
.I variable
can be a name of any command line option, like
.I magnet,
.I printf,
.I 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 <>
.BR md5sum (1)
.BR cksfv (1)
.BR ed2k_hash (1)
Bug reports are welcome!
Send them by email 
or post to the SourceForge Bug Tracking System