ne_strhash.3 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. '\" t
  2. .\" Title: ne_strhash
  3. .\" Author:
  4. .\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
  5. .\" Date: 21 January 2023
  6. .\" Manual: neon API reference
  7. .\" Source: neon 0.32.5
  8. .\" Language: English
  9. .\"
  10. .TH "NE_STRHASH" "3" "21 January 2023" "neon 0.32.5" "neon API reference"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH "NAME"
  31. ne_strhash, ne_vstrhash \- string hash interface
  32. .SH "SYNOPSIS"
  33. .sp
  34. .ft B
  35. .nf
  36. #include <ne_string\&.h>
  37. .fi
  38. .ft
  39. .HP \w'char\ *ne_strhash('u
  40. .BI "char *ne_strhash(unsigned\ int\ " "flags" ", " "\&.\&.\&." ");"
  41. .HP \w'char\ *ne_vstrhash('u
  42. .BI "char *ne_vstrhash(unsigned\ int\ " "flags" ", va_list\ " "ap" ");"
  43. .SH "DESCRIPTION"
  44. .PP
  45. The
  46. \fBne_strhash\fR
  47. and
  48. \fBne_vstrhash\fR
  49. functions can be used to create hashes\&. The varargs argument list must be
  50. \fBconst char *\fR
  51. strings followed by a
  52. NULL
  53. terminator\&. The
  54. \fIflags\fR
  55. argument must select exactly one hash algorithm from the list below, which can be optionally bitwise\-ORed with one of the formatting option\&. The hash is calculated for the concatenation of the argument list, without separators\&.
  56. .SS "Hash algorithms"
  57. .PP
  58. The following hash algorithms are available:
  59. .PP
  60. \fBNE_HASH_MD5\fR
  61. .RS 4
  62. MD5
  63. .RE
  64. .PP
  65. \fBNE_HASH_SHA256\fR
  66. .RS 4
  67. SHA\-256 (SHA\-2)
  68. .RE
  69. .PP
  70. \fBNE_HASH_SHA512\fR
  71. .RS 4
  72. SHA\-512 (SHA\-2)
  73. .RE
  74. .PP
  75. \fBNE_HASH_SHA256_256\fR
  76. .RS 4
  77. SHA\-512/256 (SHA\-2)
  78. .RE
  79. .SS "Formatting options"
  80. .PP
  81. By default, the hash is returned as a hexadecimal lower\-case character string\&. The following formatting options are available:
  82. .PP
  83. \fBNE_HASH_COLON\fR
  84. .RS 4
  85. colon\-separated hex pairs, e\&.g\&.
  86. "aa:11:22\&.\&.\&."
  87. .RE
  88. .PP
  89. \fBNE_HASH_SPACE\fR
  90. .RS 4
  91. space\-separated hex pairs, e\&.g\&.
  92. "aa 11 22\&.\&.\&."
  93. .RE
  94. .SH "RETURN VALUE"
  95. .PP
  96. The return value is the ASCII hexadecimal representation of the hash as a malloc\-allocated, NUL\-terminated string, or
  97. NULL
  98. if the hash cannot be created\&. The string length is determined by the hash algorithm (and formatting options used)\&. Support for hash algorithms is specific to the SSL toolkit with which neon is compiled\&. Some systems will further restrict hash availability at runtime, e\&.g\&. due to FIPS mode\&.
  99. .SH "AUTHOR"
  100. .PP
  101. \fBJoe Orton\fR
  102. .RS 4
  103. Author.
  104. .RE
  105. .SH "COPYRIGHT"
  106. .br