Example Calculation of The Fletcher Checksum
As an example, the checksum shall be calculated and verified for a byte stream of 0x01 0x02.
- C0_initial = 0
- C1_initial = 0
Byte | C0 = C0prev + B | C1 = C1prev + C0 |
---|---|---|
0x01 | 0x01 | 0x01 |
0x02 | 0x03 | 0x04 |
−(C0 + C1) = 0xF9 | 0x03 + 0xF9 = 0xFC | 0x04 + 0xFC = 0x00 |
−(C0 + C1) = 0x04 | 0xFC + 0x04 = 0x00 | 0x00 + 0x00 = 0x00 |
The checksum bytes are 0xF9 0x04. The transmitted byte stream is 0x01 0x02 0xF9 0x04. The receiver runs the checksum on all four bytes and calculates a passing checksum of 0x00 0x00.
Read more about this topic: Fletcher's Checksum
Famous quotes containing the words calculation and/or fletcher:
“To my thinking boomed the Professor, begging the question as usual, the greatest triumph of the human mind was the calculation of Neptune from the observed vagaries of the orbit of Uranus.
And yours, said the P.B.”
—Samuel Beckett (19061989)
“Joys as winged dreams fly fast,
Why should sadness longer last?
Grief is but a wound to woe;
Gentlest fair, mourn, mourn no moe.”
—John Fletcher (15791625)