_info 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #include <string.h>
  2. #include <stdio.h>
  3. /**
  4. * crc - routines for crc of bytes
  5. *
  6. * Cyclic Redundancy Check routines. These are reasonably fast
  7. * checksum routines, but not suitable for cryptographic use.
  8. *
  9. * They are useful for simple error detection, eg. a 32-bit CRC will
  10. * detect a single error burst of up to 32 bits.
  11. *
  12. * Example:
  13. * #include <ccan/crc/crc.h>
  14. * #include <stdio.h>
  15. * #include <stdlib.h>
  16. *
  17. * // Given IHATEMATH outputs 0x98a3b8df
  18. * int main(int argc, char *argv[])
  19. * {
  20. * if (argc != 2) {
  21. * fprintf(stderr, "Usage: %s <string>\n"
  22. * "Prints 32 bit CRC of the string\n", argv[0]);
  23. * exit(1);
  24. * }
  25. * printf("0x%08x\n", crc32c(0, argv[1], strlen(argv[1])));
  26. * exit(0);
  27. * }
  28. *
  29. * License: GPL (v2 or any later version)
  30. * Author: Gary S. Brown, Clay Haapala
  31. * Maintainer: Rusty Russell <rusty@rustcorp.com.au>
  32. */
  33. int main(int argc, char *argv[])
  34. {
  35. if (argc != 2)
  36. return 1;
  37. if (strcmp(argv[1], "depends") == 0) {
  38. printf("ccan/array_size\n");
  39. return 0;
  40. }
  41. return 1;
  42. }