Search code examples
cchecksumcrc32

compare crc32 to cksum c


I've created a CRC32 with a function and the awful table. Now, I would like to compare this return value with cksum.

Can you help me by explaining me how can I convert crc32 in order to match with the cksum return value.


Solution

  • If the output of your checksum implementation doesn't match that of some other piece of software, of course there is no general explanation of how to "fix" that.

    • If the two algorithms are not the same, the result will be different.

    • If one has bugs that doesn't match the other ones', the result will be different.

    If you really think the algorithms should be the same, then you need to study the source of the other implementation and figure out how it differs from yours.

    The code of GNU cksum is here.