Skip to content

hash

fialr hash <file> [file ...] [options]

Compute content hashes for one or more files. BLAKE3 is the primary canonical identifier. SHA256 is the secondary hash for cross-tool compatibility. No files are modified.


ArgumentDescription
fileOne or more files to hash (required)
OptionDescription
--algorithm ALGOHash algorithm: blake3, sha256, or all (default: all)
--jsonOutput as JSON to stdout

hash computes content hashes for each specified file. By default, both BLAKE3 and SHA256 are computed. Use --algorithm to restrict to a single algorithm.

Files that do not exist or are directories produce an error message and are skipped. The exit code is 0 as long as at least one file is hashed successfully.

BLAKE3 is the primary hash algorithm used throughout fialr. It serves as the canonical file identifier in XATTRs, SQLite, and all deduplication logic. BLAKE3 is faster than SHA256 while providing equivalent security properties.

SHA256 is the secondary hash. It provides cross-tool verification — SHA256 hashes can be checked against other archival tools, operating system utilities, and verification workflows that do not support BLAKE3.


Human-readable (default):

hash ~/Documents/contract.pdf
HASH ~/Documents/contract.pdf
blake3 a1b2c3d4e5f6...
sha256 f7e8d9c0b1a2...

JSON (--json):

[
{
"file": "contract.pdf",
"blake3": "a1b2c3d4e5f6...",
"sha256": "f7e8d9c0b1a2..."
}
]

JSON output goes to stdout. Human-readable output goes to stderr. This means --json output can be piped to other tools without interference from status messages.


Terminal window
# Hash a single file (both algorithms)
fialr hash ~/Documents/contract.pdf
# Hash multiple files
fialr hash *.pdf
# BLAKE3 only
fialr hash file.txt --algorithm blake3
# SHA256 only
fialr hash file.txt --algorithm sha256
# JSON output, pipe to jq
fialr hash contract.pdf --json | jq '.[0].blake3'