RHash Manual
Table of Contents
rhash - calculate/check CRC32, MD5, SHA1, TTH, ED2K, BTIH or other
hash sums.
rhash [ option ]... [ file ]...
RHash (Recursive
Hasher) computes and verifies various message digests (hash sums) of files.
Supported message digests include CRC32, MD4, MD5, SHA1, Tiger, DC++ TTH,
BitTorrent BTIH, AICH, eDonkey hash, GOST R 34.11-94, RIPEMD-160, HAS-160,
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 rhash prints sums in
SFV format with CRC32 hash sum only. To output all sums -a option should
be specified.
The default output format can be changed by renaming the
program or placing a hardlink/symlink to it with a name containig strings
‘crc32’, ‘md4’, ‘md5’, ‘sha1’, ‘tiger’, ‘tth’, ‘btih’, ‘aich’, ‘ed2k’, ‘ed2k-link’, ‘gost’, ‘ripemd160’,
‘has160’, ‘whirlpool’, ‘snefru128’, ‘snefru256’, ‘sfv’ or ‘magnet’.
The
default mode is to print hash sums for the files specified at command line.
It could be changed with the following options.
- -c, --check
- Check files with
hash sums specified by command line.
- -u, --update
- Update crc files specified
by command line. Hash sums will be calculated for all files from the same
directory which are not present in the given crc file.
- --check-embedded
- Verify
files by crc32 sum embedded in their names.
- --torrent
- Create a torrent file
for each processed file.
- -h, --help
- Help: print help screen and exit.
- -V, --version
- Version:
print version and exit.
- -B, --benchmark
- Run benchmark for selected algorithm(s).
- -C, --crc32
- CRC32: calculate and print CRC32 hash sum.
- --md4
- MD4:
calculate and print MD4 hash sum.
- -M, --md5
- MD5: calculate and print MD5 hash
sum.
- -H, --sha1
- SHA1: calculate and print SHA1 hash sum.
- -G, --tiger
- Tiger: calculate
and print Tiger hash sum.
- -T, --tth
- TTH: calculate and print DC++ TTH sum.
- --btih
- BTIH:
calculate and print BitTorrent Info Hash.
- -A, --aich
- AICH: calculate and print
AICH hash.
- -E, --ed2k
- ED2K: calculate and print eDonkey 2000 hash sum.
- -L, --ed2k-link
- eDonkey
link: calculate and print eDonkey link. This option also switches default
output format to --simple.
- -W, --whirlpool
- Whirlpool: calculate and print Whirlpool
hash sum.
- --gost
- GOST: calculate and print GOST R 34.11-94 hash, the Russian
GOST standart hash function.
- --ripemd160
- RIPEMD-160: calculate and print RIPEMD-160
hash sum.
- --has160
- HAS-160: calculate and print HAS-160 hash sum.
- --snefru128
- SNEFRU-128:
calculate and print SNEFRU-128 hash sum.
- --snefru256
- SNEFRU-256: calculate and
print SNEFRU-256 hash sum.
- -a, --all
- Calculate all supported hash sums.
- -r, --recursive
- Process directories recursively.
- -v, --verbose
- Be verbose.
- --percents
- Show percents, while calculating or checking sums
- --skip-ok
- Don’t print
OK messages for successfully verified files.
- -i, --ignore-case
- Ignore case of
filenames when updating crc files.
- --speed
- Print per-file and total processing
speed.
- -e, --embed-crc
- Rename files by inserting crc32 sum into name.
- --embed-crc-delimiter=<delimeter>
- Insert
specified <delimeter> before a crc sum in the --embed-crc mode, default is
white space. The <delimeter> can be a character or empty string.
- -q, --accept=<list>
- Set
a comma-delimited list of extensions of the files to calculate sums for.
- -t, --crc-accept=<list>
- Comma-delimited list of crc files extensions.
- --maxdepth=<levels>
- Descend
at most <levels> (a non-negative integer) levels of directories below the
command line arguments. ‘--maxdepth 0’ means only apply the tests and actions
to the command line arguments.
- -o, --output=<file>
- File to output calculated hash
sums or crc file checking results.
- -l, --log=<file>
- File to log errors and verbose
information.
- --bt-private
- Generate BTIH for private BitTorrent tracker.
- --bt-piece-length
- Set
piece length for torrent file.
- --bt-announce
- Set tracker announcement url for
torrent file. Note that this url doesn’t change BTIH hash.
- --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.
- -m, --magnet
- Print hash sums formated
as magnet links.
- --bsd
- Use BSD output format. Each hash sum is printed on separate
line after hash name and file’s path, enclosed in parentheses.
- --simple
- Use
simple output format. Each line will consist of filename and hash sums specified
by options.
- --template=<file>
- Read printf-like template from given <file>. See the
--printf option.
- -p, --printf=<format>
- Format: print format string the standard
output, interpreting ‘\’ escapes and ‘%’ directives. The escapes and directives
are:
- \n
- Newline.
- \r
- Carriage return.
- \t
- Horizontal tab.
- \\
- A literal backslash
(‘\’).
- \NNN
- The character which octal ASCII code is NNN.
- \xNN
- 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.
- %{urlname}
- URL-encoded filename.
- %s
- File’s
size in bytes.
- %c or %C
- CRC32 hash sum. Use %c for lowercase and %C for uppercase
characters.
- %m or %M
- MD5 hash.
- %h or %H
- SHA1 hash.
- %g or %G
- Tiger hash.
- %t or
%T
- TTH sum.
- %e or %E
- eDonkey hash sum.
- %l or %L
- eDonkey ed2k://... link.
- %w or %W
- Whirlpool
hash.
- %{md4}, %{btih}, %{gost}, %{has160}, %{ripemd160}, %{snefru128},
%{snefru256}, ...
- Print specified <hash-sum>. Actually the %{<hash-sum>} directive
can print any supported hash sum. Start <hash-sum> with capital letter to print
uppercased hash e.g. %{TTH}, %{Gost}.
- %x<hash>, %b<hash>, %B<hash>, %@<hash>
- Use one
of these prefixes to output specified hash in hexadecimal, base32, base64
or raw format respectively, e.g. %b{md4}, %BH or %xT.
RHash searches
for config file in the following order: the .rhashrc file in the current
directory, then ~/.rhashrc, and /etc/rhashrc.
The syntax of a config file
line is variable = value
where variables are the names of options, such
as magnet, printf, percents. Simple boolean values can be set using ‘1’,
‘on’ or ‘yes’.
Empty lines and lines starting with ‘#’ or ‘;’ are ignored.
Aleksey
Kravchenko <rhash.admin@gmail.com>
md5sum(1) cksfv(1) ed2k_hash(1)
Bug reports are welcome! Send them by email or post to SourceForge
Bug Tracking System http://sourceforge.net/projects/rhash/
Table of Contents
|