coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] cksum: add --raw option to output a binary digest


From: Pádraig Brady
Subject: Re: [PATCH] cksum: add --raw option to output a binary digest
Date: Mon, 6 Feb 2023 13:16:15 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Thunderbird/109.0

On 06/02/2023 05:46, Jim Meyering wrote:
I noticed a sporadic test failure when the bsd checksum happened to
have one or more leading zeros.
Compare these:

   $ src/cksum --raw --algorithm=bsd <<< 2|od --endian=big -An -w1024
-tu2|tr -d ' '
   35
   $ src/cksum --untagged --algorithm=bsd <<< 2
   00035     1

At first I thought I'd strip the excess zeros before comparing,
but thought it slightly better to zero-pad any too-narrow value.

The attached seems to do the job:

Oh nice one.
Merged that into the change and pushed.

thanks!
Pádraig



reply via email to

[Prev in Thread] Current Thread [Next in Thread]