sum 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. .TH SUM 1
  2. .SH NAME
  3. sum, md5sum, sha1sum \- sum and count blocks in a file
  4. .SH SYNOPSIS
  5. .B sum
  6. [
  7. .B -5r
  8. ]
  9. [
  10. .I file ...
  11. ]
  12. .PP
  13. .B md5sum
  14. [
  15. .I file ...
  16. ]
  17. .PP
  18. .B sha1sum
  19. [
  20. .B -2
  21. .I bits
  22. ] [
  23. .I file ...
  24. ]
  25. .SH DESCRIPTION
  26. By default,
  27. .I sum
  28. calculates and prints a 32-bit hexadecimal checksum,
  29. a byte count,
  30. and the name of
  31. each
  32. .IR file .
  33. The checksum is also a function of the input length.
  34. If no
  35. .IR file s
  36. are given,
  37. the standard input is
  38. summed.
  39. Other summing algorithms are available.
  40. The options are
  41. .TF -r
  42. .PD
  43. .TP
  44. .B -r
  45. Sum with the algorithm of System V's
  46. .B "sum -r"
  47. and print the length (in 1K blocks) of the input.
  48. .TP
  49. .B -5
  50. Sum with System V's default algorithm
  51. and print the length (in 512-byte blocks) of the input.
  52. .PP
  53. .I Sum
  54. is typically used to look for bad spots,
  55. to validate a file communicated over
  56. some transmission line or
  57. as a quick way to determine if two files on different machines might be the same.
  58. .PP
  59. .I Md5sum
  60. computes the 32 hex digit RSA Data Security, Inc. MD5 Message-Digest Algorithm
  61. described in RFC1321.
  62. .PP
  63. .I Sha1sum
  64. computes the 40 hex digit National Institute of Standards and Technology
  65. (NIST)
  66. SHA1 secure hash algorithm
  67. described in FIPS PUB 180-1,
  68. by default.
  69. Given the
  70. .L 2
  71. option,
  72. it instead computes the
  73. .IR bits -bit
  74. NIST SHA2 secure hash algorithm
  75. described in FIPS PUB 180-2
  76. and prints the hash in hex.
  77. Currently supported values of
  78. .I bits
  79. are
  80. 224,
  81. 256,
  82. 384,
  83. and
  84. 512.
  85. .SH SOURCE
  86. .B /sys/src/cmd/sum.c
  87. .br
  88. .B /sys/src/cmd/md5sum.c
  89. .br
  90. .B /sys/src/cmd/sha1sum.c
  91. .SH "SEE ALSO"
  92. .IR cmp (1),
  93. .IR wc (1),
  94. .IR sechash (2)