• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1xxhsum(1) -- print or check xxHash non-cryptographic checksums
2==============================================================
3
4SYNOPSIS
5--------
6
7`xxhsum [<OPTION>] ... [<FILE>] ...`
8`xxhsum -b [<OPTION>] ...`
9
10`xxh32sum` is equivalent to `xxhsum -H0`
11`xxh64sum` is equivalent to `xxhsum -H1`
12`xxh128sum` is equivalent to `xxhsum -H2`
13
14
15DESCRIPTION
16-----------
17
18Print or check xxHash (32, 64 or 128 bits) checksums.
19When no <FILE>, read standard input, except if it's the console.
20When <FILE> is `-`, read standard input even if it's the console.
21
22`xxhsum` supports a command line syntax similar but not identical to md5sum(1).
23Differences are:
24`xxhsum` doesn't have text/binary mode switch (`-b`, `-t`);
25`xxhsum` always treats files as binary file;
26`xxhsum` has a hash bit width switch (`-H`);
27
28As xxHash is a fast non-cryptographic checksum algorithm,
29`xxhsum` should not be used for security related purposes.
30
31`xxhsum -b` invokes benchmark mode. See [OPTIONS](#OPTIONS) and [EXAMPLES](#EXAMPLES) for details.
32
33OPTIONS
34-------
35
36* `-V`, `--version`:
37  Displays xxhsum version and exits
38
39* `-H`<HASHTYPE>:
40  Hash selection. <HASHTYPE> means `0`=32bits, `1`=64bits, `2`=128bits.
41  Alternatively, <HASHTYPE> `32`=32bits, `64`=64bits, `128`=128bits.
42  Default value is `1` (64bits)
43
44* `--tag`:
45  Output in the BSD style.
46
47* `--little-endian`:
48  Set output hexadecimal checksum value as little endian convention.
49  By default, value is displayed as big endian.
50
51* `-h`, `--help`:
52  Displays help and exits
53
54**The following four options are useful only when verifying checksums (`-c`)**
55
56* `-c`, `--check` <FILE>:
57  Read xxHash sums from <FILE> and check them
58
59* `-q`, `--quiet`:
60  Don't print OK for each successfully verified file
61
62* `--strict`:
63  Return an error code if any line in the file is invalid,
64  not just if some checksums are wrong.
65  This policy is disabled by default,
66  though UI will prompt an informational message
67  if any line in the file is detected invalid.
68
69* `--status`:
70  Don't output anything. Status code shows success.
71
72* `-w`, `--warn`:
73  Emit a warning message about each improperly formatted checksum line.
74
75**The following options are useful only benchmark purpose**
76
77* `-b`:
78  Benchmark mode.  See [EXAMPLES](#EXAMPLES) for details.
79
80* `-b#`:
81  Specify ID of variant to be tested.
82  Multiple variants can be selected, separated by a ',' comma.
83
84* `-B`<BLOCKSIZE>:
85  Only useful for benchmark mode (`-b`). See [EXAMPLES](#EXAMPLES) for details.
86  <BLOCKSIZE> specifies benchmark mode's test data block size in bytes.
87  Default value is 102400
88
89* `-i`<ITERATIONS>:
90  Only useful for benchmark mode (`-b`). See [EXAMPLES](#EXAMPLES) for details.
91  <ITERATIONS> specifies number of iterations in benchmark. Single iteration
92  lasts approximately 1000 milliseconds. Default value is 3
93
94EXIT STATUS
95-----------
96
97`xxhsum` exit `0` on success, `1` if at least one file couldn't be read or
98doesn't have the same checksum as the `-c` option.
99
100EXAMPLES
101--------
102
103Output xxHash (64bit) checksum values of specific files to standard output
104
105    $ xxhsum -H1 foo bar baz
106
107Output xxHash (32bit and 64bit) checksum values of specific files to standard
108output, and redirect it to `xyz.xxh32` and `qux.xxh64`
109
110    $ xxhsum -H0 foo bar baz > xyz.xxh32
111    $ xxhsum -H1 foo bar baz > qux.xxh64
112
113Read xxHash sums from specific files and check them
114
115    $ xxhsum -c xyz.xxh32 qux.xxh64
116
117Benchmark xxHash algorithm.
118By default, `xxhsum` benchmarks xxHash main variants
119on a synthetic sample of 100 KB,
120and print results into standard output.
121The first column is the algorithm,
122the second column is the source data size in bytes,
123the third column is the number of hashes generated per second (throughput),
124and finally the last column translates speed in megabytes per second.
125
126    $ xxhsum -b
127
128In the following example,
129the sample to hash is set to 16384 bytes,
130the variants to be benched are selected by their IDs,
131and each benchmark test is repeated 10 times, for increased accuracy.
132
133    $ xxhsum -b1,2,3 -i10 -B16384
134
135BUGS
136----
137
138Report bugs at: https://github.com/Cyan4973/xxHash/issues/
139
140AUTHOR
141------
142
143Yann Collet
144
145SEE ALSO
146--------
147
148md5sum(1)
149