对序列应用累加器函数。

Aggregate-LMLPHP

        /// <summary>
/// 计算校验和,SUM
/// </summary>
public byte CalculateCheckSum(byte[] data)
{
int sum = data.Aggregate(, (current, t) => current + t);
return (byte)(sum & 0x00ff);
}
05-08 15:44