I have created (under Linux) a file with following byte sequence: 0x61, 0x62, 0x63, 0x64. When I calculate the CRC32 in the cli, it returns "ed82cd11". This is consistent with the results of online calculators, found e.g. on https://crccalc.com/. To get this result, the initial value should be set to 0xFFFFFFFF and the polynom to 0x04C11DB7.
I thought, it should be simple to reproduce the result with a xmos using following code:
Code: Select all
unsigned v = 0x64636261; unsigned c = 0xFFFFFFFF; unsigned p = 0x04C11DB7; crc32(c, v, p); printf("CRC: 0x%x; inv: 0x%x\n", c, ~c); printf("Should be: 0xED82CD11; inv: 0x127D32EE \n");
I have reversed the byte order, but the result is even wrong. Can you give me a hint, how to get the correct result?CRC: 0x618cec1a; inv: 0x9e7313e5
Should be: 0xED82CD11; inv: 0x127D32EE