home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 8 Other
/
08-Other.zip
/
crcsrc.zip
/
MKCRCTBL.C
< prev
Wrap
C/C++ Source or Header
|
1997-02-04
|
398b
|
26 lines
#include <stdio.h>
#define POLY 0x8408
unsigned crctbl [256];
void main (void)
{
register unsigned i;
for (i = 0; i<= 255; i++)
{
register unsigned j, x;
x = i;
for (j = 8; j--; )
{
if (x & 1)
x = (x >> 1) ^ POLY;
else
x >>= 1;
}
printf("%s0x%04X", (i % 8 ? ", " : ",\n"), x);
}
printf(",\n");
}