V1/Cet.Develop.NETMF.IO/ByteArray/ByteArrayHelpers.cs
/// <summary>
/// Calculate the LRC of the given byte array
/// </summary>
/// <param name="buffer">The source byte array</param>
/// <param name="offset">The index of the first byte to be considered</param>
/// <param name="count">The number of the bytes to be considered</param>
/// <returns>The resulting value</returns>
Calculate the LRC of the given byte array
Calculate the LRC of the given byte array
public static byte CalcLRC(
            byte[] buffer,
            int offset,
            int count)
        {
            int lrc = 0;
            for (int i = offset, upper = offset + count; i < upper; i++)
            {
                lrc ^= buffer[i];
            }
            return (byte)lrc;
        }
public static byte CalcLRC ( byte [ ] buffer , int offset , int count ) { int lrc = 0 ; for ( int i = offset , upper = offset + count ; i < upper ; i ++ ) { lrc ^= buffer [ i ] ; } return ( byte ) lrc ; }
Calculate the LRC of the given byte array
Calculate the LRC of the given byte array
The resulting value
The resulting value
buffer
byte[]
The source byte array
The source byte array
offset
int
The index of the first byte to be considered
The index of the first byte to be considered
count
int
The number of the bytes to be considered
The number of the bytes to be considered