>  `cksum -a crc32` could be added I suppose to select the current
implementation in gnulib

both versions are CRC32 though, and then if you look at the iSCSI/SCTP
version they use CRC32-C which uses a totally different polynomial, not
just a reversed order one like gzip

> I'd be especially reluctant to add the existing cksum crc variant to
gnulib,
> since I don't see anything but cksum itself using that.

I need to research a little further, but bzip2 uses the same implementation
as cksum afaik

On Thu, 31 Oct 2024 at 18:33, Pádraig Brady <p...@draigbrady.com> wrote:

> On 31/10/2024 16:46, Sam Russell wrote:
> > I can extend coreutils cksum if you like, what are your thoughts on
> adding some parameters to the commandline? Even if it's just an extra flag
> for --rfc1952 or --gzip to change all the parameters just between these two
> variants?
>
> Well cksum already has the -a option to select between algorithms.
> `cksum -a crc` currrently select cksums POSIX crc
> (which also munges in the data length to the crc calculation).
> `cksum -a crc32` could be added I suppose to select the current
> implementation in gnulib
> (and not munge in the length). I can add that easily,
> and it probably makes sense to make this more common crc available
> (FreeBSD's cksum does for example).
>
> I'd be reluctant to complicate the gnulib implementations with variants
> unless needed.
> I'd be especially reluctant to add the existing cksum crc variant to
> gnulib,
> since I don't see anything but cksum itself using that.
>
> cheers,
> Pádraig
>

Reply via email to