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 ;这句话就是推倒不出来了,大侠们帮分析一下。 明白了,自己顶!
页:
[1]