Skip to content

noqtis-hash(1)

noqtis-hash — print or check SHA-2, SHA-3 and SHAKE digests of files

noqtis hash [-a hash] [file ...]

noqtis hash [-a hash] -c | --check [list ...]

noqtis hash prints one line per file in the format of sha256sum(1): the digest in lower-case hex, two spaces and the name. A name that holds a backslash, a line feed or a carriage return is written with ‘\\’, ‘\n’ and ‘\r’, and the line starts with a backslash, as sha256sum(1) does. With no file, or with ‘-’, it reads standard input.

With -c, each argument is a list of such lines (standard input when there is none). For every line it prints ‘<name>: OK’, ‘<name>: FAILED’ or ‘<name>: FAILED open or read’. A line may mark binary mode with ‘*’ before the name, as sha256sum(1) writes it; noqtis always reads files as bytes. Empty lines are skipped; any other line that is not a digest of the chosen hash is reported with its line number.

hash, --alg=hash
One of sha224, sha256 (the default), sha384, sha512, sha512-224, sha512-256, sha3-224, sha3-256, sha3-384, sha3-512, shake128 (32 bytes of output) and shake256 (64 bytes). With -c, every line of the lists must use this hash.
, --check
Check digests instead of printing them. A listed name that is not a regular file (a folder, a FIFO, a device) fails without being opened.

0
Every digest was printed, or every line checked.
1
With -c: a digest differs, a listed file cannot be read, a line is malformed, or no line was found.
2
A usage error or an unknown hash, a file or list that cannot be read, or standard output that cannot be written.

$ printf 'abc' > abc.txt
$ noqtis hash abc.txt
ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad  abc.txt
$ noqtis hash -a sha3-256 abc.txt > SUMS
$ noqtis hash -a sha3-256 -c SUMS
abc.txt: OK

Checking digests made by sha256sum(1):

$ sha256sum abc.txt | noqtis hash -c
abc.txt: OK

noqtis(1), sha256sum(1), nqhash(3)