F
feng7504
Unregistered / Unconfirmed
GUEST, unregistred user!
Unsigned int. crc;Unsigned int. x, i;I=0;crc=0;while (i<=包长){x=int (buff1[i]);x=x<<8;crc^=x;for (x=0; x<8; x++){ if (crc & 0x8000){ crc= (crc<<1); crc^=0x1021; } else crc= (crc<<1);}crc &=0xffff;i++;}其中buff[I]代表包长部分各个字节;