diff options
author | Pádraig Brady <P@draigBrady.com> | 2023-02-03 16:34:18 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2023-02-06 13:09:40 +0000 |
commit | ead07bb3d461389bb52336109be7858458e49c38 (patch) | |
tree | 8d905a8a307dec94d422783162fc241dc659cc48 /doc | |
parent | 2984e47c789ebc39f55a3b1cb20b943de88eeedc (diff) | |
download | coreutils-ead07bb3d461389bb52336109be7858458e49c38.tar.gz |
cksum: add --raw option to output a binary digest
--raw output is the most composable format, and also is a
robust way to discard the file name without parsing (escaped) output.
Examples:
$ cksum --raw -a crc "$afile" | basenc --base16
4ACFC4F0
$ cksum --raw -a crc "$afile" | basenc --base2msbf
01001010110011111100010011110000
$ cksum --raw -a sha256 "$bfile" | basenc --base32
AAAAAAAADHLGRHAILLQWLAY6SNH7OY5OI2RKNQLSWPY3MCUM4JXQ====
* doc/coreutils.texi (cksum invocation): Describe the new feature.
* src/digest.c (output_file): Inspect the new RAW_DIGEST global,
and output the bytes directly if set.
* src/cksum.c (output_crc): Likewise.
* src/sum.c (output_bsd, output_sysv): Likewise.
* tests/misc/cksum-raw.sh: A new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the new feature.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/coreutils.texi | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 4d7d9439d..412c513a0 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -4059,6 +4059,17 @@ input digest string as what is output. I.e., removing or adding any @opindex --debug Output extra information to stderr, like the checksum implementation being used. +@item --raw +@opindex --raw +@cindex raw binary checksum +Print only the unencoded raw binary digest for a single input. +Do not output the file name or anything else. +Use network byte order (big endian) where applicable: +for @samp{bsd}, @samp{crc}, and @samp{sysv}. +This option works only with a single input. +Unlike other output formats, @command{cksum} provides no way to +@option{--check} a @option{--raw} checksum. + @item --untagged @opindex --untagged Output using the original Coreutils format used by the other |