refhash.html 5.4 KB

123456789101112131415161718192021222324
  1. <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>ne_strhash</title><link rel="stylesheet" type="text/css" href="manual.css"><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"><link rel="home" href="index.html" title="neon HTTP/WebDAV client library"><link rel="up" href="ref.html" title="neon API reference"><link rel="prev" href="refbufdest.html" title="ne_buffer_destroy"><link rel="next" href="refparam.html" title="ne_strparam"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">ne_strhash</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="refbufdest.html">Prev</a> </td><th width="60%" align="center">neon API reference</th><td width="20%" align="right"> <a accesskey="n" href="refparam.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="refhash"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ne_strhash, ne_vstrhash — string hash interface</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="funcsynopsis"><pre class="funcsynopsisinfo">#include &lt;ne_string.h&gt;</pre><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">char *<b class="fsfunc">ne_strhash</b>(</code></td><td>unsigned int <var class="pdparam">flags</var>, </td></tr><tr><td> </td><td><var class="pdparam">...</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div><table border="0" class="funcprototype-table" summary="Function synopsis" style="cellspacing: 0; cellpadding: 0;"><tr><td><code class="funcdef">char *<b class="fsfunc">ne_vstrhash</b>(</code></td><td>unsigned int <var class="pdparam">flags</var>, </td></tr><tr><td> </td><td>va_list <var class="pdparam">ap</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1"><a name="id2270"></a><h2>Description</h2><p>The <code class="function">ne_strhash</code> and
  2. <code class="function">ne_vstrhash</code> functions can be used to
  3. create hashes. The varargs argument list must be <em class="type">const
  4. char *</em> strings followed by a <code class="literal">NULL</code> terminator. The
  5. <code class="parameter">flags</code> argument must select exactly one
  6. hash algorithm from the list below, which can be optionally
  7. bitwise-ORed with one of the formatting option. The hash is
  8. calculated for the concatenation of the argument list, without
  9. separators.</p><div class="refsect2"><a name="id2278"></a><h3>Hash algorithms</h3><p>The following hash algorithms are available:
  10. </p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top"><col></colgroup><tbody><tr><td><p><span class="term"><code class="constant">NE_HASH_MD5</code></span></p></td><td>MD5</td></tr><tr><td><p><span class="term"><code class="constant">NE_HASH_SHA256</code></span></p></td><td>SHA-256 (SHA-2)</td></tr><tr><td><p><span class="term"><code class="constant">NE_HASH_SHA512</code></span></p></td><td>SHA-512 (SHA-2)</td></tr><tr><td><p><span class="term"><code class="constant">NE_HASH_SHA256_256</code></span></p></td><td>SHA-512/256 (SHA-2)</td></tr></tbody></table></div><p>
  11. </p></div><div class="refsect2"><a name="id2302"></a><h3>Formatting options</h3><p>By default, the hash is returned as a hexadecimal
  12. lower-case character string. The following formatting
  13. options are available:
  14. </p><div class="variablelist"><table border="0" class="variablelist"><colgroup><col align="left" valign="top"><col></colgroup><tbody><tr><td><p><span class="term"><code class="constant">NE_HASH_COLON</code></span></p></td><td>colon-separated hex pairs, e.g. <code class="literal">"aa:11:22..."</code> </td></tr><tr><td><p><span class="term"><code class="constant">NE_HASH_SPACE</code></span></p></td><td>space-separated hex pairs, e.g. <code class="literal">"aa 11 22..."</code></td></tr></tbody></table></div></div></div><div class="refsect1"><a name="id2318"></a><h2>Return value</h2><p>The return value is the ASCII hexadecimal representation
  15. of the hash as a malloc-allocated, NUL-terminated string, or
  16. <code class="literal">NULL</code> if the hash cannot be created. The string length is
  17. determined by the hash algorithm (and formatting options
  18. used). Support for hash algorithms is specific to the SSL
  19. toolkit with which neon is compiled. Some systems will
  20. further restrict hash availability at runtime, e.g. due to
  21. FIPS mode.</p></div><div class="refsect1"><a name="id2322"></a><h2>History</h2><p><code class="function">ne_strhash</code> and <code class="function">ne_vstrhash</code> is
  22. available in neon 0.32.0 and later.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="refbufdest.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="refparam.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">ne_buffer_destroy </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> ne_strparam</td></tr></table></div></body></html>