RHASH(1)

✨ rhash(1) β€” User Manuals ✨

✨ NAME ✨

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

πŸ¦‹ SYNOPSIS πŸ¦‹

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

πŸ’… DESCRIPTION πŸ’…

okay so RHash (Recursive Hasher) is literally the main character of checksums. It 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, BLAKE3, EDON-R 256/512, Whirlpool, Snefru-128/256. the way that lineup ate, no cap πŸ”₯

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

A dash string parameter - is interpreted as the standard input stream (stdin). not me reading from 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. periodt ✨

πŸŽ€ PROGRAM MODE OPTIONS πŸŽ€

bestie, 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. choose your vibe:

  • -c, --check β€” 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. so clean, so organized

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 significantly slows down files verification. To speed up verification, in such case, explicitly specify the hash algorithm in the command line.

  • -u, --update=<hash-file> β€” Update the specified hash file by computing message digests for files listed in command arguments that aren't present in it. New digests are appended in the format specified by formatting options. glow up your hash file

With --recursive, updates the hash file using files from entire directory trees. With --check, verifies existing digests before updating.

  • --missing=<hash-file> β€” List files from the hash file that are missing or inaccessible in the filesystem. gone girl energy
  • --unverified=<hash-file> β€” List command-line files missing from the given hash file (unverified files). With --recursive, checks entire directory trees for unverified files. who’s missing? vibe check
  • -k, --check-embedded β€” Verify files by crc32 sum embedded in their names. name reveal
  • --torrent β€” Create a torrent file for each processed file. torrent era
  • -h, --help β€” Help: print help screen and exit. we love support
  • -V, --version β€” Version: print version and exit. flex the version
  • -B, --benchmark β€” Run benchmark for the selected hash algorithm(s). race them

πŸ”₯ HASH ALGORITHMS OPTIONS πŸ”₯

pick your fighter, bestie β€” these select which hash function(s) rhash will use. each one is iconic in its own way.

  • -C, --crc32 β€” CRC32: Select CRC32 checksum algorithm.
  • --crc32c β€” CRC32C: Select CRC32C checksum algorithm.
  • --md4 β€” MD4: Select MD4 hash function.
  • -M, --md5 β€” MD5: Select MD5 hash function.
  • -H, --sha1 β€” SHA1: Select SHA1 hash function.
  • --sha224, --sha256, --sha384, --sha512 β€” Select specified SHA2 hash function.
  • --sha3-224, --sha3-256, --sha3-384, --sha3-512 β€” Select specified SHA3 hash function.
  • --tiger β€” Tiger: Select Tiger hash function.
  • -T, --tth β€” TTH: Select DC++ TTH hash function.
  • --btih β€” BTIH: Select BitTorrent Info Hash.
  • -A, --aich β€” AICH: Select AICH hash function.
  • -E, --ed2k β€” ED2K: Select eDonkey 2000 hash function.
  • -W, --whirlpool β€” Whirlpool: Select Whirlpool hash function.
  • -G, --gost12-256 β€” GOST-2012: Select 256-bit GOST R 34.11-2012, the Russian GOST standard hash function.
  • --gost12-512 β€” GOST-2012: Select 512-bit GOST R 34.11-2012, the Russian GOST standard hash function.
  • --gost94 β€” 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.
  • --ripemd160 β€” RIPEMD-160: Select RIPEMD-160 hash function.
  • --has160 β€” HAS-160: Select HAS-160 hash function.
  • --snefru128, --snefru256 β€” SNEFRU: Select SNEFRU-128/256 hash function.
  • --edonr256, --edonr512 β€” EDON-R: Select EDON-R 256/512 hash function.
  • --blake2b, --blake2s β€” BLAKE2: Select BLAKE2b/BLAKE2s hash function.
  • --blake3 β€” BLAKE3: Select BLAKE3 hash function.
  • -a, --all β€” Calculate all supported hash functions.
  • --list-hashes β€” List names of all supported hash functions, one per line.

🌈 MISCELLANEOUS OPTIONS 🌈

the rest of the toolbox, and yes, every single one matters. πŸ’…

  • -r, --recursive β€” Recursively process directories, specified by command line. 🌳
  • --follow β€” Follow symbolic links when processing files or directories recursively. πŸ”—
  • -m, --message=<text> β€” Calculate message digests of the given text message. πŸ’¬
  • --file-list=<file> β€” 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. πŸ“
  • -v, --verbose β€” Be verbose. πŸ—£οΈ
  • --brief β€” Print brief form of verification report (without a header and footer), when verifying a hash file. βœ‚οΈ
  • -P, --percents β€” Show percents, while calculating or checking sums. πŸ“Š
  • --skip-ok β€” Don't print OK messages for successfully verified files. πŸš«βœ…
  • --ignore-missing β€” Ignore missing files, while verifying a hash file. πŸ«₯
  • -i, --ignore-case β€” Ignore case of filenames when updating crc files. πŸ” 
  • --speed β€” Print per-file and the total processing speed. 🏎️
  • -e, --embed-crc β€” Rename files by inserting crc32 sum into name. 🏷️
  • --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. πŸŽ€
  • --path-separator=<separator> β€” Use specified path separator to display paths. Only slash (/) and backslash (\) values are accepted. πŸ›£οΈ
  • -q, --accept=<list> β€” Set a comma‐delimited list of extensions of the files to process. βœ…
  • --exclude=<list> β€” Set a comma‐delimited list of extensions of the files to exclude from processing. 🚫
  • -t, --crc-accept=<list> β€” Set a comma‐delimited list of extensions of the hash files to verify. πŸ”
  • --max-depth=<levels> β€” 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. πŸ“
  • -o, --output=<file-path> β€” Set the file to output calculated message digests or verification results to. πŸ“€
  • -l, --log=<file-path> β€” Set the file to log errors and verbose information to. πŸ““
  • --openssl=<list> β€” 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. πŸ”
  • --gost-reverse β€” 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. πŸ”„
  • --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. πŸ“¦
  • --bt-private β€” Generate torrent file or BTIH for a private BitTorrent tracker. πŸ”’
  • --bt-transmission β€” Generate torrent file or BTIH compatible with Transmission torrent client. 🌊
  • --bt-piece-length β€” Set the piece length value for torrent file. 🧩
  • --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 message digest. πŸ“£
  • --benchmark-raw β€” 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. πŸ€–
  • --no-detect-by-ext β€” Do not detect hash function by an extension of hash file, in the --check mode. πŸš«πŸ”Ž
  • --no-path-escaping β€” 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. πŸ›‘

πŸŽ€ OUTPUT FORMAT OPTIONS πŸŽ€

Okay so this is the part where you pick how your hashes look when they come out. It's giving ✨aesthetic choices✨ and honestly? Every single one is valid.

  • --sfv β€” prints message digests in the SFV (Simple File Verification) output format, and yes bestie, this one's the default. But heads up β€” unlike a common SFV file, it's not just CRC32 here: any message digests you specified with options can get printed. We're flexible like that πŸ’…
  • -g, --magnet β€” prints message digests formatted as magnet links 🧲 (iykyk)
  • --bsd β€” uses the BSD output format. Every message digest gets its own separate line, printed after the hash function name and the file's path, all wrapped up in parentheses πŸŽ€
  • --simple β€” uses the simple output format. Each line is just the filename plus the message digests you asked for by options. No drama, no extras.
  • --one-hash β€” one message digest per line, and literally no extra file information. Just the hash, bestie, nothing else πŸ¦‹
  • -L, --ed2k-link β€” prints an eDonkey link containing the file name, the file size, and the ED2K and AICH message digests 🐴
  • --hex β€” prints message digests in hexadecimal format
  • --base32 β€” prints message digests in Base32 format
  • -b, --base64 β€” prints message digests in Base64 format
  • --uppercase β€” prints message digests in UPPER CASE πŸ“’
  • --lowercase β€” prints message digests in lower case 🀫
  • --template=<file> β€” reads a printf‐like template from the given <file>. Peep the --printf option below for the deets πŸ‘€
  • -p, --printf=<format> β€” the format string gets printed to standard output, and it interprets \ escapes and % directives. Here's the whole menu of escapes and directives, bestie, don't skip any:
    • \n β€” Newline.
    • \r β€” Carriage return.
    • \t β€” Horizontal tab.
    • \\ β€” A literal backslash (\).
    • \0 β€” ASCII NUL.
    • \NNN β€” The character whose octal ASCII code is NNN.
    • \xNN β€” The character whose hexadecimal ASCII code is NN.
    • A \ character followed by any other character is treated as an ordinary character, so both of them get printed.
    • %% β€” A literal percent sign.
    • %p β€” File's path.
    • %f β€” File's name.
    • %d β€” File's directory.
    • %u or %U β€” A 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}, %{blake3}, %{snefru128}, %{snefru256} β€” Print the specified message digest. It gets 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, %xT.

And here's a lil plot twist: the default output format can also be changed by renaming the program, or by placing a hardlink/symlink to it with a filename that contains any of these 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, blake3, snefru128, snefru256, sfv , bsd or magnet. Naming your binary your whole personality? Slay, honestly 🌈


🌸 CONFIG FILE 🌸

RHash goes looking for a config file in these spots, in this order of addresses: $XDG_CONFIG_HOME/rhash/rhashrc, $HOME/.config/rhash/rhashrc, $XDG_CONFIG_DIRS/rhash/rhashrc, $HOME/.rhashrc and /etc. It's giving "I checked everywhere for you, bestie" 🫢

The config file is made of lines formatted like this:

variable = value

where variable can be the name of any command line option β€” like magnet, printf, percents, etc. A boolean variable can be set to true by a value of on, yes or true; any other value sets the variable to false. (Yes, it's that simple, no cap.)

Empty lines, plus lines starting with # or ;, are ignored. We love a clean file ✨

Example config file:

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

πŸ’– AUTHOR πŸ’–

Aleksey Kravchenko <rhash.admin@gmail.com> β€” the icon, the legend, the moment πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€

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


πŸ’€ BUGS πŸ’€

Bug reports are welcome! Post them to the GitHub issues page https://github.com/rhash/RHash/issues β€” go tell them everything, bestie, they genuinely wanna hear it πŸ›


and that's the whole page, bestie!! πŸ’…βœ¨ This one's living on Linux, dated APR 2010, and its name is RHASH(1) β€” iconic, timeless, obsessed. Go hash something and make me proud πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from