91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

crc32源代碼32位crc校驗碼生成程序源代碼vc++測試通過 http://hi.baidu.com/yanzi52351

資源截圖

代碼片段和文件信息

//?crc1.cpp?:?Defines?the?entry?point?for?the?console?application.
//http://hi.baidu.com/yanzi52351
//yanzi52351@126.com

#include?“stdafx.h“
#include?
#include?

unsigned?long??int?crc32_table[256];
unsigned?long?int?ulPolynomial?=?0x04c11db7;

unsigned?long?int?Reflect(unsigned?long?int?ref?char?ch){
unsigned?long?int?value=0;
int?i;?
for(i?=?1;?i? if(ref?&?1)
value?|=?1?< ref?>>=?1;
}
return?value;
}


void?init_crc32_table(){
unsigned?long?int?crctemp;
unsigned?long?int?t1t2;
unsigned?long?int?flag;
int?ij;
for(i?=?0;?i?<=?0xFF;?i++){
temp=Reflect(i?8);
crc32_table[i]=?temp< for?(j?=?0;?j?
flag=crc32_table[i]&0x80000000;
t1=(crc32_table[i]?< if(flag==0)
t2=0;
else
t2=ulPolynomial;
crc32_table[i]?=t1^t2?;

}
crc=crc32_table[i];
crc32_table[i]?=?Reflect(crc32_table[i]?32);
}
return;

}

unsigned?long?GenerateCRC32(char*?DataBufunsigned?long??len)???//crc32生成函數
{???
unsigned?long??oldcrc32;???
unsigned?long??crc32;???
unsigned?long??oldcrc;???
unsigned?int??charcnt;???
char?ct;???
oldcrc32=0x00000000;???//初值為0???
charcnt=0;???
while(len--)
{???
t=?(oldcrc32>>24)&0xFF;???????//要移出的字節的值???
oldcrc=crc32_table[t];???????????????????//根據移出的字節的值查表???
c=DataBuf[charcnt];?????????????????????//新移進來的字節值???
oldcrc32=(oldcrc32<<8)|c;???????//將新移進來的字節值添在寄存器末字節中???
oldcrc32=oldcrc32^oldcrc;???????????//將寄存器與查出的值進行xor運算???
charcnt++;???
}???
crc32=oldcrc32;???
return???crc32;???
??}?

int?main(int?argc?char*?argv[])
{
char?test[6]={‘b‘‘c‘‘d‘‘d‘‘d‘‘r‘};
init_crc32_table();?????????//先生成
GenerateCRC32(testsizeof(test));

return?0;
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????1863??2010-05-20?15:35??crc1\crc1.cpp

?????文件???????4512??2010-05-19?20:44??crc1\crc1.dsp

?????文件????????516??2010-05-19?20:44??crc1\crc1.dsw

?????文件??????50176??2010-05-20?15:35??crc1\crc1.ncb

?????文件??????48640??2010-05-20?15:35??crc1\crc1.opt

?????文件???????1390??2010-05-20?15:34??crc1\crc1.plg

?????文件????????202??2010-05-20?15:35??crc1\crc1.positions

?????文件?????172120??2010-05-20?15:34??crc1\Debug\crc1.exe

?????文件???????1196??2010-05-19?20:44??crc1\ReadMe.txt

?????文件????????291??2010-05-19?20:44??crc1\StdAfx.cpp

?????文件????????769??2010-05-19?20:44??crc1\StdAfx.h

?????目錄??????????0??2010-05-20?15:37??crc1\Debug

?????目錄??????????0??2010-05-20?15:35??crc1

?????文件????????119??2010-05-20?15:07??我的空間.url

?????文件????????125??2010-05-20?15:08??說明.url

-----------?---------??----------?-----??----

???????????????281919????????????????????15


評論

共有 條評論