#include "crc32.h"Go to the source code of this file.
Defines | |
| #define | STEPCRC(crc, byte) crc = crc_table[((int)crc ^ (byte)) & 0xff] ^ (crc >> 8) |
Functions | |
| uint32 | CRC32_Start (void) |
| uint32 | CRC32_Finish (uint32 crc) |
| uint32 | CRC32_AddByte (uint32 crc, uint8 b) |
| uint32 | CRC32_AddWord (uint32 crc, uint16 w) |
| uint32 | CRC32_AddLong (uint32 crc, uint32 l) |
| uint32 | CRC32_Array (const uint8 *buf, uint32 buflen) |
Variables | |
| uint32 | crc_table [256] |
|
|
Definition at line 80 of file crc32.c. Referenced by CRC32_AddByte(), CRC32_AddLong(), CRC32_AddWord(), and CRC32_Array(). |
|
||||||||||||
|
Definition at line 92 of file crc32.c. References STEPCRC, and uint32.
00093 {
00094 STEPCRC(crc,b);
00095 return(crc);
00096 }
|
|
||||||||||||
|
Definition at line 107 of file crc32.c. References STEPCRC, uint32, and uint8.
|
|
||||||||||||
|
Definition at line 98 of file crc32.c. References STEPCRC, uint32, and uint8.
|
|
||||||||||||
|
Definition at line 118 of file crc32.c. References STEPCRC, and uint32. Referenced by Hash_StringToKey().
00119 {
00120 uint32 crc = (~((uint32)0));
00121
00122 if (!buf ) return 0;
00123
00124 while( (buflen&0xF) != 0 )
00125 {
00126 STEPCRC(crc,*buf); buf++;
00127 buflen--;
00128 }
00129
00130 buflen>>=4; /* 16 at a time */
00131
00132 while(buflen--)
00133 {
00134 STEPCRC(crc,*buf); buf++;
00135 STEPCRC(crc,*buf); buf++;
00136 STEPCRC(crc,*buf); buf++;
00137 STEPCRC(crc,*buf); buf++;
00138
00139 STEPCRC(crc,*buf); buf++;
00140 STEPCRC(crc,*buf); buf++;
00141 STEPCRC(crc,*buf); buf++;
00142 STEPCRC(crc,*buf); buf++;
00143
00144 STEPCRC(crc,*buf); buf++;
00145 STEPCRC(crc,*buf); buf++;
00146 STEPCRC(crc,*buf); buf++;
00147 STEPCRC(crc,*buf); buf++;
00148
00149 STEPCRC(crc,*buf); buf++;
00150 STEPCRC(crc,*buf); buf++;
00151 STEPCRC(crc,*buf); buf++;
00152 STEPCRC(crc,*buf); buf++;
00153 }
00154
00155 crc ^= 0xFFFFFFFF;
00156
00157 return crc;
00158 }
|
|
|
Definition at line 87 of file crc32.c. References uint32.
00088 {
00089 return (~crc);
00090 }
|
|
|
Definition at line 82 of file crc32.c. References uint32.
00083 {
00084 return (~((uint32)0));
00085 }
|
|
|
|
1.3.2