阅读:1797回复:3
请帮忙确定一下
有一段英文,是求校验和的,如下:
The last byte in the 250-byte block represents a checksum value for the entire 250-byte block of data. The checksum value for each 250-byte block is determined by the binary addition of the first 249 bytes and the subsequent subtraction of the sum from AA(hex). 其校验和的求法是否如下所似,请帮忙确认一下。 BYTE checksum = 0; for ( int i=1; i<=249; i++) { checksum += data; //data[251]为存放250个BYTE数据的数组 } checksum = 0xAA - checksum; |
|