coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

cksum: `-b` shouldn't be a shortcut of `--base64`

Open cakebaker opened this issue 1 year ago • 2 comments

Currently, we use -b as a shortcut for --base64. However, this is incorrect, the behavior of -b was changed in GNU 9.4 according to https://github.com/coreutils/coreutils/blob/master/NEWS:

'cksum -b' no longer prints base64-encoded checksums.  Rather that
  short option is reserved to better support emulation of the standalone
  checksum utilities with cksum.

For most algorithms, -b is a shortcut for --binary.

Thanks to @Rudxain for pointing out this issue in https://github.com/uutils/coreutils/pull/6187#issuecomment-2080306876

cakebaker avatar Apr 27 '24 06:04 cakebaker

it will be fixed by https://github.com/uutils/coreutils/pull/6256/files#diff-72cab80d2a2bb2f434c03de3fe87a5b9b953f489255f85f9576158ba60d309a1L454

sylvestre avatar Apr 27 '24 08:04 sylvestre

Honestly, I didn't even expect to be right, haha. According to toybox md5sum --help: "Brief (hash only, no filename)". I was confused because I'm used to the Toybox implementation (because of Android), then I went to the Termux distribution of GNU coreutils and it said -b is "binary". I expected Toybox to have less features, not entirely different APIs! I was proven wrong

Rudxain avatar Apr 27 '24 09:04 Rudxain

Fixed by https://github.com/uutils/coreutils/pull/6256

cakebaker avatar May 16 '24 14:05 cakebaker