/// <summary>
/// 算术和和校验,数组为16进制数组,返回值为算是和校验,低位,10进制数字
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
public int ArithmeticSumVerification(byte[] data)
{
int cks = 0;
foreach (byte item in data)
{
cks = (cks + item) % 0xffff;
}
data[data.Length - 2] = (byte)((cks & 0xff00) >> 8);//取校验和高8位
data[data.Length - 1] = (byte)(cks & 0xff);//低8位
return data[data.Length - 1];//只取低八位
}