mysunmax 发表于 2012-8-10 16:53:31

CRC32 求助

int main()
{
/**//// the data
unsigned long data = 0x1011035b;
/**//// load the register with the data
unsigned long regi = 0;
/**//// allocate memory to contain the data
unsigned char p;
/**//// copy data
memcpy( p, &data, 4 );

/**//// the table
unsigned long table;
/**//// create the table
create_table( table );

/**//// because data contains 4 bytes
for( int i = 0; i < 4; ++ i )
{
regi = ( regi << 8 ) ^ table[ ( regi >> 24 ) ^ p ];
}

/**//// and now, register contains the remainder which is also called CRC value.

return 0;
}
、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、、
regi = ( regi << 8 ) ^ table[ ( regi >> 24 ) ^ p ;这句话就是推倒不出来了,大侠们帮分析一下。

mysunmax 发表于 2012-8-14 22:26:33

明白了,自己顶!
页: [1]
查看完整版本: CRC32 求助