亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? crc循環校驗的具體算法方案.txt

?? CRC循環校驗的具體算法方案 用vc++ 實現
?? TXT
字號:
/********************************************************************** 
* 
* Filename: main.c 
* 
* Description: A simple test program for the CRC implementations. 
* 
* Notes: To test a different CRC standard, modify crc.h. 
* 
* 
* Copyright (c) 2000 by Michael Barr. This software is placed into 
* the public domain and may be used for any purpose. However, this 
* notice must not be changed or removed and no warranty is either 
* expressed or implied by its publication or distribution. 
**********************************************************************/ 


#include <stdio.h> 
#include <string.h> 

#include "crc.h" 


void 
main(void) 
{ 
unsigned char test[] = "123456789"; 


/* 
* Print the check value for the selected CRC algorithm. 
*/ 
printf("The check value for the %s standard is 0x%X\n", CRC_NAME, 
CHECK_VALUE); 

/* 
* Compute the CRC of the test message, slowly. 
*/ 
*/ 
printf("The crcSlow() of \"123456789\" is 0x%X\n", crcSlow(test, 
strlen(test))); 

/* 
* Compute the CRC of the test message, more efficiently. 
*/ 
crcInit(); 
printf("The crcFast() of \"123456789\" is 0x%X\n", crcFast(test, 
strlen(test))); 

} /* main() */ 

/********************************************************************** 
* 
* Filename: crc.h 
* 
* Description: A header file describing the various CRC standards. 
* 
* Notes: 
* 
* 
* Copyright (c) 2000 by Michael Barr. This software is placed into 

* the public domain and may be used for any purpose. However, this 
* notice must not be changed or removed and no warranty is either 
* expressed or implied by its publication or distribution. 
**********************************************************************/ 

#ifndef _crc_h 
#define _crc_h 


#define FALSE 0 
#define TRUE !FALSE 

/* 
* Select the CRC standard from the list that follows. 
*/ 
#define CRC_CCITT 


#if defined(CRC_CCITT) 

typedef unsigned short crc; 


#define CRC_NAME "CRC-CCITT" 
#define POLYNOMIAL 0x1021 
#define INITIAL_REMAINDER 0xFFFF 
#define FINAL_XOR_VALUE 0x0000 
#define REFLECT_DATA FALSE 
#define REFLECT_REMAINDER FALSE 
#define CHECK_VALUE 0x29B1 

#elif defined(CRC16) 

typedef unsigned short crc; 

#define CRC_NAME "CRC-16" 
#define POLYNOMIAL 0x8005 
#define INITIAL_REMAINDER 0x0000 
#define FINAL_XOR_VALUE 0x0000 
#define REFLECT_DATA TRUE 
#define REFLECT_REMAINDER TRUE 
#define CHECK_VALUE 0xBB3D 

#elif defined(CRC32) 


typedef unsigned long crc; 

#define CRC_NAME "CRC-32" 
#define POLYNOMIAL 0x04C11DB7 
#define INITIAL_REMAINDER 0xFFFFFFFF 
#define FINAL_XOR_VALUE 0xFFFFFFFF 
#define REFLECT_DATA TRUE 
#define REFLECT_REMAINDER TRUE 
#define CHECK_VALUE 0xCBF43926 

#else 

#error "One of CRC_CCITT, CRC16, or CRC32 must be #define'd." 

#endif 


void crcInit(void); 
crc crcSlow(unsigned char const message[], int nBytes); 
crc crcFast(unsigned char const message[], int nBytes); 



#endif /* _crc_h */ 



/********************************************************************** 
* 
* Filename: crc.c 
* 
* Description: Slow and fast implementations of the CRC standards. 
* 
* Notes: The parameters for each supported CRC standard are 
* defined in the header file crc.h. The implementtations 
* here should stand up to further additions to thaat list. 
* 
* 
* Copyright (c) 2000 by Michael Barr. This software is placed into 
* the public domain and may be used for any purpose. However, this 
* notice must not be changed or removed and no warranty is either 
* expressed or implied by its publication or distribution. 
**********************************************************************/ 

#include "crc.h" 
#include "crc.h" 


/* 
* Derive parameters from the standard-specific parameters in crc.h. 
*/ 
#define WIDTH (8 * sizeof(crc)) 
#define TOPBIT (1 << (WIDTH - 1)) 

#if (REFLECT_DATA == TRUE) 
#undef REFLECT_DATA 
#define REFLECT_DATA(X) ((unsigned char) reflect((X), 8)) 
#else 
#undef REFLECT_DATA 
#define REFLECT_DATA(X) (X) 
#endif 

#if (REFLECT_REMAINDER == TRUE) 
#undef REFLECT_REMAINDER 
#define REFLECT_REMAINDER(X) ((crc) reflect((X), WIDTH)) 
#else 
#undef REFLECT_REMAINDER 
#define REFLECT_REMAINDER(X) (X) 

#endif 


/********************************************************************* 
* 
* Function: reflect() 
* 
* Description: Reorder the bits of a binary sequence, by reflecting 
* them about the middle position. 
* 
* Notes: No checking is done that nBits <= 32. 
* 
* Returns: The reflection of the original data. 
* 
*********************************************************************/ 
static unsigned long 
reflect(unsigned long data, unsigned char nBits) 
{ 
unsigned long reflection = 0x00000000; 
unsigned char bit; 

/* 
/* 
* Reflect the data about the center bit. 
*/ 
for (bit = 0; bit < nBits; ++bit) 
{ 
/* 
* If the LSB bit is set, set the reflection of it. 
*/ 
if (data & 0x01) 
{ 
reflection |= (1 << ((nBits - 1) - bit)); 
} 

data = (data >> 1); 
} 

return (reflection); 

} /* reflect() */ 


/********************************************************************* 
* 
* 
* Function: crcSlow() 
* 
* Description: Compute the CRC of a given message. 
* 
* Notes: 
* 
* Returns: The CRC of the message. 
* 
*********************************************************************/ 
crc 
crcSlow(unsigned char const message[], int nBytes) 
{ 
crc remainder = INITIAL_REMAINDER; 
int byte; 
unsigned char bit; 


/* 
* Perform modulo-2 division, a byte at a time. 
*/ 
for (byte = 0; byte < nBytes; ++byte) 
{ 
{ 
/* 
* Bring the next byte into the remainder. 
*/ 
remainder ^= (REFLECT_DATA(message[byte]) << (WIDTH - 8)); 

/* 
* Perform modulo-2 division, a bit at a time. 
*/ 
for (bit = 8; bit > 0; --bit) 
{ 
/* 
* Try to divide the current data bit. 
*/ 
if (remainder & TOPBIT) 
{ 
remainder = (remainder << 1) ^ POLYNOMIAL; 
} 
else 
{ 
remainder = (remainder << 1); 
} 
} 
} 
} 

/* 
* The final remainder is the CRC result. 
*/ 
return (REFLECT_REMAINDER(remainder) ^ FINAL_XOR_VALUE); 

} /* crcSlow() */ 


crc crcTable[256]; 


/********************************************************************* 
* 
* Function: crcInit() 
* 
* Description: Populate the partial CRC lookup table. 
* 
* Notes: This function must be rerun any time the CRC standard 
* is changed. If desired, it can be run "offline"" and 
* the table results stored in an embedded system'ss ROM. 

* 
* Returns: None defined. 
* 
*********************************************************************/ 
void 
crcInit(void) 
{ 
crc remainder; 
int dividend; 
unsigned char bit; 


/* 
* Compute the remainder of each possible dividend. 
*/ 
for (dividend = 0; dividend < 256; ++dividend) 
{ 
/* 
* Start with the dividend followed by zeros. 
*/ 
remainder = dividend << (WIDTH - 8); 


/* 
* Perform modulo-2 division, a bit at a time. 
*/ 
for (bit = 8; bit > 0; --bit) 
{ 
/* 
* Try to divide the current data bit. 
*/ 
if (remainder & TOPBIT) 
{ 
remainder = (remainder << 1) ^ POLYNOMIAL; 
} 
else 
{ 
remainder = (remainder << 1); 
} 
} 

/* 
* Store the result into the table. 
*/ 
crcTable[dividend] = remainder; 

} 

} /* crcInit() */ 


/********************************************************************* 
* 
* Function: crcFast() 
* 
* Description: Compute the CRC of a given message. 
* 
* Notes: crcInit() must be called first. 
* 
* Returns: The CRC of the message. 
* 
*********************************************************************/ 
crc 
crcFast(unsigned char const message[], int nBytes) 
{ 
crc remainder = INITIAL_REMAINDER; 
unsigned char data; 
int byte; 
int byte; 


/* 
* Divide the message by the polynomial, a byte at a time. 
*/ 
for (byte = 0; byte < nBytes; ++byte) 
{ 
data = REFLECT_DATA(message[byte]) ^ (remainder >> (WIDTH - 8)); 
remainder = crcTable[data] ^ (remainder << 8); 
} 

/* 
* The final remainder is the CRC. 
*/ 
return (REFLECT_REMAINDER(remainder) ^ FINAL_XOR_VALUE); 

} /* crcFast() */ 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美大胆一级视频| 日韩精品中午字幕| 韩国视频一区二区| 午夜亚洲福利老司机| 亚洲精品自拍动漫在线| 亚洲精品日产精品乱码不卡| 亚洲黄色免费电影| 亚洲成av人片一区二区三区| 视频一区二区不卡| 日本中文在线一区| 国产在线日韩欧美| 99r国产精品| 欧美精品丝袜久久久中文字幕| 欧美日韩一级二级| 精品美女一区二区三区| 亚洲欧美激情插 | 午夜精品久久久久久久久久久| 中文字幕第一区综合| 老司机精品视频导航| 激情丁香综合五月| 欧美日韩一区二区欧美激情 | 91天堂素人约啪| 日韩一区二区视频在线观看| 国产精品视频在线看| 日韩高清在线观看| a亚洲天堂av| 欧美精品一区二| 蜜臀av性久久久久蜜臀aⅴ流畅| 一本到三区不卡视频| 国产人妖乱国产精品人妖| 日韩中文字幕一区二区三区| 成人的网站免费观看| 久久免费国产精品| 国产一区视频在线看| 久久色在线观看| 国产精品剧情在线亚洲| 欧美激情自拍偷拍| 久久91精品久久久久久秒播| 欧美一级艳片视频免费观看| 欧美a级理论片| 国产精品国产三级国产普通话99 | 久久中文娱乐网| 欧美精选一区二区| 成人app在线| 日韩美女视频在线| 激情五月激情综合网| 国产女人18毛片水真多成人如厕 | 成人av免费在线播放| 亚洲精品国产视频| 国产在线精品一区二区夜色| 奇米精品一区二区三区在线观看一 | 成人免费观看av| 中文字幕中文字幕一区二区| 在线成人免费视频| 国产成人亚洲精品青草天美| 综合激情成人伊人| 久久久久久久久岛国免费| 成年人国产精品| 国内精品在线播放| 亚洲国产综合在线| 悠悠色在线精品| 中文字幕在线观看不卡视频| 欧美一区二区三区白人| 91色porny蝌蚪| 福利一区二区在线观看| 奇米777欧美一区二区| 亚洲国产你懂的| 国产欧美一区二区精品性色| 99久久婷婷国产综合精品| 欧美人成免费网站| 欧美在线免费视屏| 91精品在线观看入口| 欧美日韩你懂的| 制服丝袜日韩国产| 久久午夜老司机| 欧美国产综合一区二区| 欧美精品一区二区三区蜜臀| 久久影院视频免费| 国产精品每日更新在线播放网址| 久久蜜桃av一区精品变态类天堂| 91精品国产综合久久久蜜臀粉嫩| 欧美日韩中文一区| 欧美成人vps| 亚洲色欲色欲www在线观看| 日韩理论电影院| 日本午夜精品视频在线观看| 国产精品综合av一区二区国产馆| 国产精品一区专区| 在线亚洲欧美专区二区| 欧美丰满嫩嫩电影| 欧美性猛片xxxx免费看久爱| ...xxx性欧美| 日韩精品一二三区| 国产不卡视频在线播放| 欧美中文字幕一区二区三区| 精品久久久久久综合日本欧美 | 成人激情校园春色| av电影在线不卡| 日韩一区二区精品葵司在线| 亚洲三级小视频| 日本91福利区| 欧美日免费三级在线| 精品国产三级电影在线观看| 午夜激情综合网| 成人午夜私人影院| 日韩精品专区在线| 日韩vs国产vs欧美| 7777精品伊人久久久大香线蕉经典版下载 | 欧美精品少妇一区二区三区| 欧美精品久久99| 高清成人免费视频| 国产精品女人毛片| av电影天堂一区二区在线观看| 久久九九99视频| 国产盗摄一区二区| 亚洲码国产岛国毛片在线| av亚洲精华国产精华精华 | 综合激情网...| 欧美在线三级电影| 蜜臀av一区二区三区| 欧美成人一级视频| 国产精品1区2区| 亚洲特黄一级片| 7777精品伊人久久久大香线蕉完整版 | 国产伦精品一区二区三区视频青涩 | 日韩成人午夜电影| 99视频精品全部免费在线| 亚洲色图在线视频| 91精品啪在线观看国产60岁| 国模冰冰炮一区二区| xfplay精品久久| 成人av第一页| 精品综合免费视频观看| 国产视频视频一区| 制服.丝袜.亚洲.中文.综合| 国产成人综合在线播放| 午夜视频在线观看一区二区三区| 久久蜜桃av一区二区天堂| 91丨porny丨首页| 国产经典欧美精品| 韩国成人精品a∨在线观看| 亚洲一区二区精品视频| 欧美夫妻性生活| 欧美国产视频在线| 久久免费美女视频| 亚洲精品在线三区| 26uuu亚洲| 精品国产伦一区二区三区免费| 在线不卡中文字幕| 欧美一级黄色录像| 精品国产一区二区国模嫣然| 色吧成人激情小说| 欧美一区二区三区视频免费播放| 欧美电影一区二区三区| 精品国产sm最大网站免费看| 欧美成人精品二区三区99精品| 色综合欧美在线| 欧美日本在线观看| 精品国产伦一区二区三区免费| 日韩欧美精品在线| 日本一区二区视频在线观看| 欧美激情综合在线| 亚洲综合色区另类av| 国产成人精品免费一区二区| www.欧美亚洲| 欧美三级电影精品| 337p亚洲精品色噜噜噜| 色婷婷综合久久久中文字幕| 日本不卡123| 色综合夜色一区| 中文字幕av一区二区三区免费看 | 国产成人综合在线观看| 国产成人午夜精品影院观看视频| 色94色欧美sute亚洲线路二| 久久久久国产免费免费| 中文字幕亚洲精品在线观看| 国产在线播放一区| 欧美无乱码久久久免费午夜一区| 精品少妇一区二区三区视频免付费| 亚洲美女在线国产| 欧美视频一二三区| 国产精品短视频| 国内精品免费**视频| 精品久久久久av影院| 日韩vs国产vs欧美| 久久免费偷拍视频| 不卡电影一区二区三区| 久久婷婷国产综合国色天香| 国产精品中文字幕一区二区三区| 久久欧美一区二区| 欧美激情一区二区三区在线| 天堂va蜜桃一区二区三区| 成人午夜激情影院| 亚洲欧美另类在线| 91麻豆精品国产91久久久使用方法 | 久久蜜桃香蕉精品一区二区三区| 蜜桃精品视频在线| 国产日韩成人精品| 欧美探花视频资源| 成人晚上爱看视频|