X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fcrc%2F_info;fp=ccan%2Fcrc%2F_info;h=c3f0b7635e221b6007f42274995dd3db7e9b2abb;hp=0000000000000000000000000000000000000000;hb=570c9c555f076e74f46141bb42b5d1d7ac89f632;hpb=8f61c0bccb152b2365baf70deac1e59264d7feb7 diff --git a/ccan/crc/_info b/ccan/crc/_info new file mode 100644 index 00000000..c3f0b763 --- /dev/null +++ b/ccan/crc/_info @@ -0,0 +1,42 @@ +#include + +/** + * crc - routines for crc of bytes + * + * Cyclic Redundancy Check routines. These are reasonably fast + * checksum routines, but not suitable for cryptographic use. + * + * They are useful for simple error detection, eg. a 32-bit CRC will + * detect a single error burst of up to 32 bits. + * + * Example: + * #include + * #include + * #include + * + * int main(int argc, char *argv[]) + * { + * if (argc != 2) { + * fprintf(stderr, "Usage: %s \n" + * "Prints 32 bit CRC of the string\n", argv[0]); + * exit(1); + * } + * printf("0x%08x\n", crc32c(argv[1], strlen(argv[1]))); + * exit(0); + * } + * + * Licence: GPL (v2 or any later version) + * Author: Gary S. Brown, Clay Haapala + * Maintainer: Rusty Russell + */ +int main(int argc, char *argv[]) +{ + if (argc != 2) + return 1; + + if (strcmp(argv[1], "depends") == 0) { + return 0; + } + + return 1; +}