math - My checksum of 5 bytes of data does not -


i'm processing 6-byte messages piece of serial hardware. in manual, manufacturer has laid out checksum of each message (its 6th byte) composed of 'the low byte of summation of rest of message.'

here 1 of examples, dissected

here others

i haven't tried examples yet, let me show work on first 'dissected' example:

this formula provided:

low byte of 0xb2 + 0x00 + 0x69 + 0x1a + 0x83 = 0x68

so, summation 0x1b8, if take first 8-bits, 0xb8 hmmm... doing wrong?

i thought bit , guessed, oh, maybe bitwise-operation instead, that's pretty common on older hardware right? wrote out bits of each part , xored series together...

  • 0xb2 ^ 0x00 = 0xb2 (duh)
  • 0xb2 ^ 0x69 = 0xdb
  • 0xdb ^ 0x1a = 0xc1
  • 0xc1 ^ 0x83 = 0x42

i did hand, , calculator. same result.

i able reproduce computations in program, checksums pretty different hardware outputting. manual model number matches hardware have...

looking @ binary of each part of summation, i'm not sure can see clear pattern each documented output. in checksums, ipv4 header, carry shifted or added checksum, case here?

my question is:

am making math error in how checksum being calculated?

any appreciated! thank you.

i attacked samples windows rt calculator, , of others (here) fine - it's the first example (which dissected) erroneous. looks simple documentation typo.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -