xxh32sum 0.8.4 by Yann Collet
Create or verify checksums using fast non-cryptographic algorithm xxHash
Usage: xxh32sum [options] [files]
When no filename provided or when '-' is provided, uses stdin as input.
Options:
-H# select an xxhash algorithm (default: 0)
0: XXH32
1: XXH64
2: XXH128 (also called XXH3_128bits)
3: XXH3 (also called XXH3_64bits)
-c, --check read xxHash checksum from [files] and check them
--files-from generate hashes for files listed in [files]
--filelist generate hashes for files listed in [files]
- forces stdin as input, even if it's the console
-h, --help display a long help page about advanced options
Advanced:
-V, --version Display version information
--tag Produce BSD-style checksum lines
--little-endian Checksum values use little endian convention (default: big endian)
--binary Read in binary mode
-s#, --seed # Set seed (default: 0)
-b Run benchmark
-b# Bench only algorithm variant #
-i# Number of times to run the benchmark (default: 3)
-B# Block size to hash per benchmark iteration (default: 102400 B)
-q, --quiet Don't display version header in benchmark mode
The following five options are useful only when using lists in [files] to verify or generate checksums:
-q, --quiet Don't print OK for each successfully verified hash
--status Don't output anything, status code shows success
--strict Exit non-zero for improperly formatted lines in [files]
--warn Warn about improperly formatted lines in [files]
--ignore-missing Don't fail or report status for missing files
Options (22)
| Option | Description | Source |
|---|
-H# | select an xxhash algorithm (default: 0) 0: XXH32 1: XXH64 2: XXH128 (also called XXH3_128bits) 3: XXH3 (also called XXH3_64bits) | help |
-c, --check FILE | read xxHash checksum from [files] and check them | help + man |
--files-from FILE | Read filenames from FILE and generate hashes for them. | help + man |
--filelist | generate hashes for files listed in [files] | help |
-h, --help | display a long help page about advanced options | help + man |
-V, --version | Displays xxhsum version and exits | help + man |
--tag | Produce BSD-style checksum lines | help + man |
--little-endian | Checksum values use little endian convention (default: big endian) | help + man |
--binary | Accepted for compatibility. | help + man |
-s#, --seed, -sSEED # | Set the unsigned decimal seed used for hashing and checksum verification. | help + man |
-b | Benchmark mode. | help + man |
-b# | Specify ID of variant to be tested. | help + man |
-i# | Number of times to run the benchmark (default: 3) | help |
-B# | Block size to hash per benchmark iteration (default: 102400 B) | help |
-q, --quiet | Don´t print OK for each successfully verified hash. | help + man |
--status | Don't output anything, status code shows success | help + man |
--strict | Return an error code if any line in FILE is invalid, not just if some checksums are wrong. | help + man |
--warn, -w | Emit a warning message about each improperly formatted line in FILE. | help + man |
-HHASHTYPE | Hash selection. (in the manual page but not in --help) | man |
--ignore-missing | Don´t fail or report status for missing files. (in the manual page but not in --help) | man |
-BBLOCKSIZE | Only useful for benchmark mode (-b). (in the manual page but not in --help) | man |
-iITERATIONS | Only useful for benchmark mode (-b). (in the manual page but not in --help) | man |
Exit status (2) from the manual page
0 | success |
1 | at least one file couldn´t be read or doesn´t have the same checksum as the -c option |
Examples (10) from the manual page, untested
xxhsum -H1 foo bar baz
Output xxHash (64bit) checksum values of specific files to standard outputxxhsum -H0 foo bar baz > xyz.xxh32
Output xxHash (32bit and 64bit) checksum values of specific files to standard output, and redirect it to xyz.xxh32 and qux.xxh64xxhsum -H1 foo bar baz > qux.xxh64
Output xxHash (32bit and 64bit) checksum values of specific files to standard output, and redirect it to xyz.xxh32 and qux.xxh64xxhsum -c xyz.xxh32 qux.xxh64
Read xxHash sums from specific files and check themfind . -type f -name ´*.[ch]´ > c-files.txt
Produce a list of files, then generate hashes for that listxxhsum --files-from c-files.txt
Produce a list of files, then generate hashes for that listfind . -type f -name ´*.[ch]´ | xxhsum --files-from -
Read the list of files from standard input to avoid the need for an intermediate filexxhsum `find . -name ´*.[ch]´`
Note that if shell expansion, length of argument list, clarity of use of spaces in filenames, etc allow it then the same output as the previous example can be generated like thisxxhsum -b
Benchmark xxHash algorithm.xxhsum -b1,2,3 -i10 -B16384
In the following example, the sample to hash is set to 16384 bytes, the variants to be benched are selected by their IDs, and each benchmark test is repeated 10 times, for increased accuracy.
Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.