Re: simple transport protocol
- From: Willem <willem@xxxxxxxx>
- Date: Mon, 26 May 2008 06:49:25 +0000 (UTC)
Roman wrote:
) Hello, Willem!
) You wrote on Mon, 26 May 2008 06:18:53 +0000 (UTC):
)
) W> Suppose the checksum is a simple sum modulo 256.
) W> We want to send the values: 2 5 8 10 15 20
) W> So, the total of what we send is this:
)
) W> length | data | crc
)
)
) W> 0 7 2 5 8 10 15 20 196
)
) W> What I do _is_ sum % 256. Read it again, more carefully.
) Alright, from the example above, considering the values are decimal:
) 2+5+8+10+15+20 = 60, 60 mod 256 = 60, not 196. How then you get 196?
Here's the bit that I wrote that you did not quote:
) >Now, if we calculate the checksum on the seven received bytes:
) >2+5+8+10+15+20+196 (modulo 256) = 0
) >
) >This 0 means the check succeeded, no compare necessary.
SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
.
- References:
- simple transport protocol
- From: Roman Mashak
- Re: simple transport protocol
- From: Willem
- Re: simple transport protocol
- From: Roman Mashak
- Re: simple transport protocol
- From: Willem
- Re: simple transport protocol
- From: Roman Mashak
- Re: simple transport protocol
- From: Willem
- Re: simple transport protocol
- From: Roman Mashak
- simple transport protocol
- Prev by Date: Re: The spinoza papers: design of the extra-precision number object 2
- Next by Date: Re: In-place algorithm
- Previous by thread: Re: simple transport protocol
- Next by thread: Re: simple transport protocol
- Index(es):
Relevant Pages
|