|
Kevin Baker wrote:
>
> Hi,
>
> I'm kinda new to LUGNET, so if I get this wrong - sorry!
>
> I'm interested in this LNP idea that seemed to be floating around a few months
> ago. Is it still alive, and if so what state has it got to? I would be
> grateful if someone can post or e-mail me the current state of LNP (even if it
> has died!) & where I might find more info on the work & thoughts up till now.
>
> Also:
> In lugnet.robotics.rcx.legos, Jacob S. Barrett writes:
> >
> > 32+PAYLOADLEN-32+PAYLOADLEN+16: CRC16 was an idea thrown out as a
> > solution. Might be overkill?
>
> I'm curious here. Was CRC16 thrown out coz it was too CPU intensive? If so,
> may I suggest the following algorithm (Minus typos!):
>
> unsigned short
> checksum(
> unsigned char *data,
> unsigned length
> ) {
> unsigned char a = 0xff;
> unsigned char b = 0xff;
>
> while (length > 0) {
> a = a + *data;
> b = b + a;
> data++;
> length--;
> }
>
> return a + (b * 256);
> }
>
> It may look simple, but it is about as effective as CRC16 (It is actually
> derived, if my memory serves me right, from somewhere within OSI protocol
> Level 4). Even if it doesn't end up in LNP, it is worth sticking in your
> software toolbox, as it is soooo easy & quick to implement.
I remember that! But aren't you supposed to do it mod 255 for maximum
effectiveness?
Cheers,
Ben.
--
http://www.apache-ssl.org/ben.html
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
- Indira Gandhi
|
|
Message has 1 Reply: | | Re: LNP Repost (Checksum algorithm)
|
| This has little (Err... nothing in fact) to do with Lego, but worth noting as it is handy when you need a good SW checksum! (...) Indeed, as you say the standard I mentioned does use mod 255 (See Annex C ISO/IEC 8473-1 : 1994 [(URL) As far as I can (...) (25 years ago, 28-Jul-99, to lugnet.robotics.rcx.legos)
|
Message is in Reply To:
| | Re: LNP Repost
|
| Hi, I'm kinda new to LUGNET, so if I get this wrong - sorry! I'm interested in this LNP idea that seemed to be floating around a few months ago. Is it still alive, and if so what state has it got to? I would be grateful if someone can post or e-mail (...) (25 years ago, 27-Jul-99, to lugnet.robotics.rcx.legos)
|
21 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
This Message and its Replies on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|