I am porting some code from C on OSX to C# that uses CommonCrypto with the kCN_CRC_64_ECMA_182
CRC64 implementation. For example, using CommonCrypto the CRC would be computed with:
CNCRC(kCN_CRC_64_ECMA_182, bytes, bytesLen, &crcResult)
This outputs the correct value. When using the C# library HashLib (or any other code), the output is completely different, for example, the equivalent to the above using HashLib would be:
var checksum = HashFactory.Checksum.CreateCRC64(0x42F0E1EBA9EA3693UL); // ECMA 182
var result = checksum.ComputeBytes(bytes);
Any ideas? Is there an implementation in C# that is equivalent to Apple's CommonCrypto in terms of output?
Here is some simple C code to compute the ECMA-182 CRC:
I think HashLib is simply wrong, judging by what I found on github. It is doing the CRC reflected, whereas the CRC64 defined in ECMA-182 is not reflected.