3 * cc crc32.c /usr/src/sys/libkern/{crc32.c,icrc32.c} -o ~/bin/crc32
11 uint32_t iscsi_crc32(const void *buf
, size_t size
);
12 uint32_t iscsi_crc32_ext(const void *buf
, size_t size
, uint32_t ocrc
);
13 uint32_t crc32(const void *buf
, size_t size
);
14 uint32_t crc32_ext(const void *buf
, size_t size
, uint32_t ocrc
);
19 main(int ac
, char **av
)
24 u_int32_t crc1
= iscsi_crc32(NULL
, 0);
26 u_int32_t crc2
= crc32(NULL
, 0);
29 while ((n
= read(0, buf
, sizeof(buf
))) > 0) {
31 crc1
= iscsi_crc32_ext(buf
, n
, crc1
);
33 crc2
= crc32_ext(buf
, n
, crc2
);
37 printf("iscsi_crc32 %08x\n", crc1
);
39 printf("crc32 %08x\n", crc2
);