/// <summary>Calculates the CRC-CCITT check-sum on specified portion of a buffer.</summary>
/// <param name="data">Data buffer to perform check-sum on.</param>
/// <param name="startIndex">Starts index in data buffer to begin check-sum.</param>
/// <param name="length">Total number of bytes from <paramref name="startIndex">startIndex</paramref> to
/// perform check-sum over.</param>
/// <returns>Computed CRC-CCITT checksum over the specified portion of the buffer.</returns>
/// <remarks>
/// The CRC-CCITT is a table based 16-bit CRC popular for modem protocols defined for use by the
/// Consultative Committee on International Telegraphy and Telephony (CCITT)
/// </remarks>
public static ushort CrcCCITTChecksum(this byte[] data, int startIndex, int length)
{
CrcCCITT checksum = new CrcCCITT();
checksum.Update(data, startIndex, length);
return(checksum.Value);
}