uint32_t soft_crc32_st(uint32_t *pbuf, uint32_t size)
{
const uint32_t st_const_value = 0x04c11db7;
uint32_t crc_value = 0xffffffff;
uint32_t xbit;
uint32_t bits;
uint32_t i;
for(i = 0;i < size;i ++)
{
xbit = 0x80000000;
for (bits = 0; bits < 32; bits++)
{
if (crc_value & 0x80000000)
{
crc_value <<= 1;
crc_value ^= st_const_value;
}
else
{
crc_value <<= 1;
}
if (pbuf[i] & xbit)
{
crc_value ^= st_const_value;
}
xbit >>= 1;
}
}
return crc_value;
}