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.
-a
hash,
--alg=hashsha224, 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.-c,
--check-c: a digest differs, a listed file cannot be
read, a line is malformed, or no line was found.$ 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