CRC-8 checksum calculation
Posted: Sat Feb 22, 2014 10:08 am
Hello FC community,
at the moment it try to find my way to the CRC checksum operation.
In a RS232 serial byte transmission I have as an example the following byte sequence:
0x7E 0x9F 0x4C 0xA1 0xA8 0x5D 0x55 0x00 0x11 0xE8 0x23 0x21 0x1B 0x00 0xF4
0xF4 the last byte is a CRC checksum made with a polynomial X^8 + X^2 + X + 1 and the underlined byte group. From what I read and learned this polynomial should look like the following bit sequence: 100000111 (9Bits)
In the intranet I found the following CRC-8 checksum calculator: http://smbus.org/faq/crc8Applet.htm
If I drop in the above byte sequence in the CRC-8 calculator ( 4CA1A85D550011E823211B00 ) I get exactly 0xF4 as a result.
If I work with only one byte and the CRC-8 calculator. For example I take the first underlined byte( 0x4C ) and put it in the calculator,
I get 0xE3 as a result. So far so good. From my knowledge this checksum is made with the following math. Starting with 0x4c = 0b01001100 = 0b1001100
100110000000000 “Adding 8 times zero from the a polynomial”
100000111 The polynomial (9Bit)
000110111000000 XOR result
>>>100000111 Again the polynomial
000010111111000 XOR result
>>>>100000111 Again the polynomial
>>>>00111100100 XOR result
>>>>>>100000111 Again the polynomial
>>>>>>011100011 XOR final result 0xE3!! Bingo!!
My problem now is how can I apply / create the above CRC checksum calculation / workflow in Flow Code. I´m using FC4. Every learning help is aprechiated.
Best regards Dirk
at the moment it try to find my way to the CRC checksum operation.
In a RS232 serial byte transmission I have as an example the following byte sequence:
0x7E 0x9F 0x4C 0xA1 0xA8 0x5D 0x55 0x00 0x11 0xE8 0x23 0x21 0x1B 0x00 0xF4
0xF4 the last byte is a CRC checksum made with a polynomial X^8 + X^2 + X + 1 and the underlined byte group. From what I read and learned this polynomial should look like the following bit sequence: 100000111 (9Bits)
In the intranet I found the following CRC-8 checksum calculator: http://smbus.org/faq/crc8Applet.htm
If I drop in the above byte sequence in the CRC-8 calculator ( 4CA1A85D550011E823211B00 ) I get exactly 0xF4 as a result.
If I work with only one byte and the CRC-8 calculator. For example I take the first underlined byte( 0x4C ) and put it in the calculator,
I get 0xE3 as a result. So far so good. From my knowledge this checksum is made with the following math. Starting with 0x4c = 0b01001100 = 0b1001100
100110000000000 “Adding 8 times zero from the a polynomial”
100000111 The polynomial (9Bit)
000110111000000 XOR result
>>>100000111 Again the polynomial
000010111111000 XOR result
>>>>100000111 Again the polynomial
>>>>00111100100 XOR result
>>>>>>100000111 Again the polynomial
>>>>>>011100011 XOR final result 0xE3!! Bingo!!
My problem now is how can I apply / create the above CRC checksum calculation / workflow in Flow Code. I´m using FC4. Every learning help is aprechiated.
Best regards Dirk