1 /* crc32hash.c - derived from linux/lib/crc32.c, GNU GPL v2 */
3 $ ./crc32hash "Dual Speed"
11 static unsigned int crc32(unsigned char const *p
, unsigned int len
)
17 for (i
= 0; i
< 8; i
++)
18 crc
= (crc
>> 1) ^ ((crc
& 1) ? 0xedb88320 : 0);
23 int main(int argc
, char **argv
) {
26 printf("no string passed as argument\n");
29 result
= crc32((unsigned char const *)argv
[1], strlen(argv
[1]));
30 printf("0x%x\n", result
);
This page took 0.030956 seconds and 5 git commands to generate.