coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

cksum: Unsupported multiple hash encodings in the same file

Open RenjiSann opened this issue 6 months ago • 0 comments

In a file, several line format may be present at the same time, this is not handled with our implementation.

See:

$ echo -n foo > foo

$ ../gnu/src/cksum --algo=sha224 foo > sum
$ ../gnu/src/cksum --algo=sha224 --base64 foo >> sum
$ cat sum
SHA224 (foo) = 0808f64e60d58979fcb676c96ec938270dea42445aeefcd3a4e6f8db
SHA224 (foo) = CAj2TmDViXn8tnbJbsk4Jw3qQkRa7vzTpOb42w==
$ ../gnu/src/cksum --check sum
foo: OK
foo: OK

$ target/debug/cksum --check sum
foo: OK
../target/debug/cksum: WARNING: 1 line is improperly formatted

RenjiSann avatar Aug 17 '24 20:08 RenjiSann