I\'ve tried the example from wikipedia: http://en.wikipedia.org/wiki/Longitudinal_redundancy_check
This is the code for lrc (C#):
///
The corrected Wikipedia version is as follows:
private byte calculateLRC(byte[] b) { byte lrc = 0x00; for (int i = 0; i < b.Length; i++) { lrc = (byte)((lrc + b[i]) & 0xFF); } lrc = (byte)(((lrc ^ 0xff) + 2) & 0xFF); return lrc; }