]> git.ipfire.org Git - thirdparty/coreutils.git/commit
cksum: add --algorithm option to select digest mode
authorPádraig Brady <P@draigBrady.com>
Mon, 6 Sep 2021 14:17:12 +0000 (15:17 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 15 Sep 2021 19:44:16 +0000 (20:44 +0100)
commitad6c8e1181a3966e35d68c1c354deb1c73f3e974
tree43ec3b95effbbaa70ae782b79e6c2f26883590ea
parent6a5c561b4fb3018d284d03747c612527e0c89571
cksum: add --algorithm option to select digest mode

* src/digest.c: Organize HASH_ALGO_CKSUM to be table driven,
and amalgamate all digest algorithms.
(main): Parse all options if HASH_ALGO_CKSUM, and disallow
--tag, --zero, and --check with the traditional bsd, sysv, and crc
checksums for now.
* src/local.mk: Reorganize to include all digest modules in cksum.
* tests/misc/cksum-a.sh: Add a new test.
* tests/misc/b2sum.sh: Update to default to checking with cksum,
as b2sum's implementation diverges a bit from the others.
* tests/local.mk: Reference the new test.
* doc/coreutils.texi (cksum invocation): Adjust the summary to
identify the new mode, and document the new --algorithm option.
* man/cksum.x: Adjust description to be more general.
* man/*sum.x: Add [See Also] section referencing cksum(1).
* NEWS: Mention the new feature.
15 files changed:
NEWS
doc/coreutils.texi
man/b2sum.x
man/cksum.x
man/md5sum.x
man/sha1sum.x
man/sha224sum.x
man/sha256sum.x
man/sha384sum.x
man/sha512sum.x
src/digest.c
src/local.mk
tests/local.mk
tests/misc/b2sum.sh
tests/misc/cksum-a.sh [new file with mode: 0755]