Merge branch 'vendor/LIBEDIT'
[dragonfly.git] / test / debug / crc32.c
1
2 /*
3  * cc crc32.c /usr/src/sys/libkern/crc32.c -o /usr/local/bin/crc32
4  */
5
6 #include <sys/types.h>
7 #include <stdio.h>
8 #include <stdlib.h>
9 #include <unistd.h>
10
11 int
12 main(int ac, char **av)
13 {
14     char buf[256];
15     int n;
16     u_int32_t crc = crc32(NULL, 0);
17
18     while ((n = read(0, buf, sizeof(buf))) > 0)
19         crc = crc32_ext(buf, n, crc);
20     printf("crc %08x\n", crc);
21     return(0);
22 }