On 05/09/2025 19:45, Denis Excoffier wrote:
Hello,
Please add to cksum the option --base64url like --base64 added recently 
(release 9.2, 2023-03-20).
Indeed, tr ‘+/‘ ‘-_’ is not an easy option (‘tr’ applies to filename) even if 
stdin is used (filename is ‘-‘).
Of course, basenc also works great to produce the same (using e.g. cksum -a 
sha1 --raw).

I'm not sure a --base64url option is warranted.
As you've noted you can get that encoding of the hash like:

  sha1_b64url() { cksum -a sha1 --raw "$1" | basenc --base64url; }

--base64 was added to cksum so that checksums could be written more concisely.
However --base64url is not more concise so I'm not sure of your use case.

If we were to support multiple encodings with cksum it may be better
to have --encoding={hex,base64,...}, but as I said I'm not convinced of the 
need.

cheers,
Padraig

Reply via email to