IDK if this will help you, but I hope it does.
If you are trying to calculate CRC 8 here is a great website:
http://smbus.org/faq/crc8Applet.htm
If this is the CRC 8 you require, then here is code to make it happen... Code should be easy to implement, but if you have any questions on how to use it no problem.
/*************************************************************************
* Function Name: init_crc8
* Parameters: void
* Return: Loads a static array and sets a static variable flag
*
* Description: Loads a CRC8 polynomial checksum array (256 bytes). Sets the static
* value to indicate the array is loaded.
* STEP 1: Load the array x^8 + x^2 + x + 1
* STEP 2: Set the static varible that the array has been loaded
*************************************************************************/
void
init_crc8()
{
inti,j;
unsignedcharcrc;
// STEP 1if(!MadeTable)
{
for(i=0; i<256; i++)
{
crc = i;
for(j=0; j<8; j++)
crc = (crc << 1) ^ ((crc & 0x80) ? DI : 0);
crc8_table[i] = crc & 0xFF;
}
// STEP 2
MadeTable =
true;
}
}
// END OF init_crc8
/*************************************************************************
* Function Name: crc8
* Parameters: unsigned char *, unsigned char
* Return: Loads a static array and sets a static variable flag
*
* Description: For a byte array whose accumulated crc value is stored in *crc, computes
* resultant crc obtained by appending m to the byte array. Note, befor calling the crc must
* be first set to 0.
* STEP 1: Check if table loaded - if not load
* STEP 2: Calculate the present checksum via use of crc table
*************************************************************************/
void
crc8(unsignedchar*crc, unsignedcharm)
{
// STEP 1if(!MadeTable)
init_crc8();
// STEP 2
*crc = crc8_table[(*crc) ^ m];
*crc &= 0xFF;
}
// END OF crc8