Generates a CRC value for the given data or continues the CRC calculation from previous data to the current data.
#include <smsutapi.h> UINT32 NWSMGenerateCRC ( UINT32 size, UINT32 crc, BUFFERPTR ptr);
(IN) Specifies the number of bytes in the buffer pointed to by ptr.
(IN) Specifies the initial CRC value (-1) or a previously accumulated CRC.
(IN) Points to the data used in calculating the CRC.
If NWSMGenerateCRC is successful, it returns the new CRC value.
NWSMGenerateCRC returns a 32-bit CRC. A CRC value needs to be calculated for the whole data set. However, the whole data set cannot be brought into memory; so the data set is broken into sections and CRC values are generated for each section. CRC values generated for the previous section are passed to NWSMGenerateCRC when calculating the current section’s CRC.
#include <smsutapi.h> UINT32 genCRC, size, crc = -1; BUFFERPTR ptr; /* Set ptr to point to a buffer and set size to the number of data bytes in the buffer */ genCRC = NWSMGenerateCRC(size, crc, ptr);