校验和代码(CheckSum)

int CUpdateProtocal::GetCheckSumNum(char* pcData, int iSize)

{

	if(pcData == NULL)

		return NULL;

	unsigned char ulCheckSum = pcData[0];

	for(unsigned char cCounter = 1; cCounter <iSize; cCounter++)

	{

	 	ulCheckSum = ulCheckSum^pcData[cCounter];

	}

	return ulCheckSum;

}


你可能感兴趣的:(null)