LinuxCommandLibrary

xxhsum

Calculate and verify XXH64 checksums

TLDR

Calculate the checksum for a file using a specific algorithm

$ xxhsum -H[0|32|64|128] [path/to/file]
copy

Run benchmark
$ xxhsum -b
copy

SYNOPSIS

xxhsum [OPTIONS] [FILE]...

PARAMETERS

-b, --binary
    Read in binary mode. This is the default on non-MSDOS-like systems.

-c, --check
    Read xxHash sums from the FILEs and check them.

--exclude-missing
    When used with --check, don't fail or report status for missing files

--ignore-missing
    Alias for --exclude-missing, deprecated.

-l, --length LEN
    Truncate output hash to LEN bits. Use multiples of 4. If LEN is greater than the hash's digest size, it's truncated to it.

--little-endian
    Set the digest to little endian byte order. Only valid for XXH128.

-q, --quiet
    Don't print OK for each successfully verified file.

-r, --recursive
    Process directories recursively.

-s, --seed SEED
    Specify a seed for the hash function (default: 0). Must be a positive 32-bit integer.

-S, --status
    Don't print anything, only return an exit code indicating success or failure.

-t, --text
    Read in text mode (default on MSDOS-like systems).

-v, --verbose
    Output verbose diagnostic information.

-0, --zero-terminated
    End each input line with NUL, not newline

--algorithm ALGORITHM
    Specify the xxHash algorithm to use (xxh3, xxh64, xxh32, xxh128). Default is xxh3.

--version
    Display version information and exit.

--help
    Display this help and exit.

DESCRIPTION

xxhsum is a command-line utility for computing and verifying file checksums using xxHash algorithms. It is designed for speed and efficiency, especially with large files. It supports various xxHash variants, including xxh3 and xxh64. xxhsum aims to be a modern replacement for traditional checksum tools like md5sum, sha256sum, and sha1sum, offering significantly faster performance.

The output format is similar to that of the GNU coreutils tools, making it relatively easy to integrate into existing workflows and scripts. xxhsum is commonly used for data integrity verification, file comparison, and deduplication. The tool provides options for binary and text modes, as well as reading file names from standard input. It is written in C and optimized for performance. It offers flexibility when working with large amounts of data or scenarios where speed is critical.

CAVEATS

xxhsum is relatively new compared to traditional checksum tools; therefore, it might not be as widely supported across all systems. Always ensure the target system has xxhsum installed when verifying checksums.

EXIT STATUS

The exit status is 0 if all files were processed successfully. Non-zero is returned on errors, including files that could not be read or verified.

ALGORITHM CHOICE

The choice of hashing algorithm (xxh3, xxh64, etc.) depends on the specific requirements for speed, collision resistance, and output size. xxh3 is generally recommended for its improved speed and security compared to earlier versions.

SEE ALSO

md5sum(1), sha256sum(1), sha1sum(1)

Copied to clipboard