Hello would you be able to post the solution for this? I have a scenario where its been mentioned that my message will be sent in the following format STX Data ETX BCC And that BCC = LRC - XOR over all characters excluding STX but including ETX. I am kind of trying to figure out how this works? Here is the LRCCalculation method I have implemented.
private char CalculateLongitudinalRedundancyCheck(string source)
{
int result = 0;
for (int i = 0; i < source.Length; i++)
{
result = result ^ (Byte)(Encoding.ASCII.GetBytes(source.Substring(i, 1))[0]);
}
return (Char)result;
}
I get the LRC from this and then what...!! For ex: say my data is something like "345565645023495767714.12.1988021114:33 15.8001".