fletcher checksum

Joakim Tjernlund joakim.tjernlund at transmode.se
Tue Apr 27 23:35:52 CEST 2010


Peter Lieven <pli at peering.eu> wrote on 2010/04/27 16:48:38:
>
>
> >> You know what the fix is? a (int) type cast like so:
> >>   x = (int)((length - LSA_CHECKSUM_OFFSET) * c0 - c1) % 255;
> >>
> >
> > Yes, i noticed that.
> >
> >
>
> I'm totally not in sync with this thread, but are you sure,
> that you really want to do a modulo 255 operation and
> not modulo 256 ( & 0xff ) here?

How does that work with negative numbers?




More information about the Bird-users mailing list