diff options
Diffstat (limited to 'static/freebsd/man9/hash.9 3.html')
| -rw-r--r-- | static/freebsd/man9/hash.9 3.html | 211 |
1 files changed, 0 insertions, 211 deletions
diff --git a/static/freebsd/man9/hash.9 3.html b/static/freebsd/man9/hash.9 3.html deleted file mode 100644 index 7c754137..00000000 --- a/static/freebsd/man9/hash.9 3.html +++ /dev/null @@ -1,211 +0,0 @@ -<table class="head"> - <tr> - <td class="head-ltitle">HASH(9)</td> - <td class="head-vol">Kernel Developer's Manual</td> - <td class="head-rtitle">HASH(9)</td> - </tr> -</table> -<div class="manual-text"> -<section class="Sh"> -<h1 class="Sh" id="NAME"><a class="permalink" href="#NAME">NAME</a></h1> -<p class="Pp"><code class="Nm">hash</code>, <code class="Nm">hash32</code>, - <code class="Nm">hash32_buf</code>, <code class="Nm">hash32_str</code>, - <code class="Nm">hash32_strn</code>, <code class="Nm">hash32_stre</code>, - <code class="Nm">hash32_strne</code>, <code class="Nm">jenkins_hash</code>, - <code class="Nm">jenkins_hash32</code>, - <code class="Nm">murmur3_32_hash</code>, - <code class="Nm">murmur3_32_hash32</code> — <span class="Nd">general - kernel hashing functions</span></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">SYNOPSIS</a></h1> -<p class="Pp"><code class="In">#include - <<a class="In">sys/hash.h</a>></code></p> -<p class="Pp"><var class="Ft">uint32_t</var> - <br/> - <code class="Fn">hash32_buf</code>(<var class="Fa" style="white-space: nowrap;">const - void *buf</var>, <var class="Fa" style="white-space: nowrap;">size_t - len</var>, <var class="Fa" style="white-space: nowrap;">uint32_t - hash</var>);</p> -<p class="Pp"><var class="Ft">uint32_t</var> - <br/> - <code class="Fn">hash32_str</code>(<var class="Fa" style="white-space: nowrap;">const - void *buf</var>, <var class="Fa" style="white-space: nowrap;">uint32_t - hash</var>);</p> -<p class="Pp"><var class="Ft">uint32_t</var> - <br/> - <code class="Fn">hash32_strn</code>(<var class="Fa" style="white-space: nowrap;">const - void *buf</var>, <var class="Fa" style="white-space: nowrap;">size_t - len</var>, <var class="Fa" style="white-space: nowrap;">uint32_t - hash</var>);</p> -<p class="Pp"><var class="Ft">uint32_t</var> - <br/> - <code class="Fn">hash32_stre</code>(<var class="Fa" style="white-space: nowrap;">const - void *buf</var>, <var class="Fa" style="white-space: nowrap;">int end</var>, - <var class="Fa" style="white-space: nowrap;">const char **ep</var>, - <var class="Fa" style="white-space: nowrap;">uint32_t hash</var>);</p> -<p class="Pp"><var class="Ft">uint32_t</var> - <br/> - <code class="Fn">hash32_strne</code>(<var class="Fa" style="white-space: nowrap;">const - void *buf</var>, <var class="Fa" style="white-space: nowrap;">size_t - len</var>, <var class="Fa" style="white-space: nowrap;">int end</var>, - <var class="Fa" style="white-space: nowrap;">const char **ep</var>, - <var class="Fa" style="white-space: nowrap;">uint32_t hash</var>);</p> -<p class="Pp"><var class="Ft">uint32_t</var> - <br/> - <code class="Fn">jenkins_hash</code>(<var class="Fa" style="white-space: nowrap;">const - void *buf</var>, <var class="Fa" style="white-space: nowrap;">size_t - len</var>, <var class="Fa" style="white-space: nowrap;">uint32_t - hash</var>);</p> -<p class="Pp"><var class="Ft">uint32_t</var> - <br/> - <code class="Fn">jenkins_hash32</code>(<var class="Fa" style="white-space: nowrap;">const - uint32_t *buf</var>, <var class="Fa" style="white-space: nowrap;">size_t - count</var>, <var class="Fa" style="white-space: nowrap;">uint32_t - hash</var>);</p> -<p class="Pp"><var class="Ft">uint32_t</var> - <br/> - <code class="Fn">murmur3_32_hash</code>(<var class="Fa" style="white-space: nowrap;">const - void *buf</var>, <var class="Fa" style="white-space: nowrap;">size_t - len</var>, <var class="Fa" style="white-space: nowrap;">uint32_t - hash</var>);</p> -<p class="Pp"><var class="Ft">uint32_t</var> - <br/> - <code class="Fn">murmur3_32_hash32</code>(<var class="Fa" style="white-space: nowrap;">const - uint32_t *buf</var>, <var class="Fa" style="white-space: nowrap;">size_t - count</var>, <var class="Fa" style="white-space: nowrap;">uint32_t - hash</var>);</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">DESCRIPTION</a></h1> -<p class="Pp">The - <a class="permalink" href="#hash32"><code class="Fn" id="hash32">hash32</code></a>() - functions are used to give a consistent and general interface to a decent - hashing algorithm within the kernel. These functions can be used to hash - ASCII <code class="Dv">NUL</code> terminated strings, as well as blocks of - memory.</p> -<p class="Pp">A <var class="Fa">len</var> argument is the length of the buffer - in bytes. A <var class="Fa">count</var> argument is the length of the buffer - in 32-bit words.</p> -<p class="Pp" id="hash32_buf">The - <a class="permalink" href="#hash32_buf"><code class="Fn">hash32_buf</code></a>() - function is used as a general buffer hashing function. The argument - <var class="Fa">buf</var> is used to pass in the location, and - <var class="Fa">len</var> is the length of the buffer in bytes. The argument - <var class="Fa">hash</var> is used to extend an existing hash, or is passed - the initial value <code class="Dv">HASHINIT</code> to start a new hash.</p> -<p class="Pp" id="hash32_str">The - <a class="permalink" href="#hash32_str"><code class="Fn">hash32_str</code></a>() - function is used to hash a <code class="Dv">NUL</code> terminated string - passed in <var class="Fa">buf</var> with initial hash value given in - <var class="Fa">hash</var>.</p> -<p class="Pp" id="hash32_strn">The - <a class="permalink" href="#hash32_strn"><code class="Fn">hash32_strn</code></a>() - function is like the <code class="Fn">hash32_str</code>() function, except - it also takes a <var class="Fa">len</var> argument, which is the maximal - length of the expected string.</p> -<p class="Pp" id="hash32_stre">The - <a class="permalink" href="#hash32_stre"><code class="Fn">hash32_stre</code></a>() - and - <a class="permalink" href="#hash32_strne"><code class="Fn" id="hash32_strne">hash32_strne</code></a>() - functions are helper functions used by the kernel to hash pathname - components. These functions have the additional termination condition of - terminating when they find a character given by <var class="Fa">end</var> in - the string to be hashed. If the argument <var class="Fa">ep</var> is not - <code class="Dv">NULL</code>, it is set to the point in the buffer at which - the hash function terminated hashing.</p> -<p class="Pp" id="jenkins_hash">The - <a class="permalink" href="#jenkins_hash"><code class="Fn">jenkins_hash</code></a>() - function has same semantics as the <code class="Fn">hash32_buf</code>(), but - provides more advanced hashing algorithm with better distribution.</p> -<p class="Pp" id="jenkins_hash32">The - <a class="permalink" href="#jenkins_hash32"><code class="Fn">jenkins_hash32</code></a>() - uses same hashing algorithm as the <code class="Fn">jenkins_hash</code>() - function, but works only on <var class="Ft">uint32_t</var> sized arrays, - thus is simpler and faster. It accepts an array of - <var class="Ft">uint32_t</var> values in its first argument and size of this - array in the second argument.</p> -<p class="Pp" id="murmur3_32_hash">The - <a class="permalink" href="#murmur3_32_hash"><code class="Fn">murmur3_32_hash</code></a>() - and - <a class="permalink" href="#murmur3_32_hash32"><code class="Fn" id="murmur3_32_hash32">murmur3_32_hash32</code></a>() - functions are similar to <code class="Fn">jenkins_hash</code>() and - <code class="Fn">jenkins_hash32</code>(), but implement the 32-bit version - of MurmurHash3.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="RETURN_VALUES"><a class="permalink" href="#RETURN_VALUES">RETURN - VALUES</a></h1> -<p class="Pp">The <code class="Fn">hash32</code>() functions return a 32 bit - hash value of the buffer or string.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="EXAMPLES"><a class="permalink" href="#EXAMPLES">EXAMPLES</a></h1> -<div class="Bd Bd-indent Li"> -<pre>LIST_HEAD(head, cache) *hashtbl = NULL; -u_long mask = 0; - -void -sample_init(void) -{ - - hashtbl = hashinit(numwanted, type, flags, &mask); -} - -void -sample_use(char *str, int len) -{ - uint32_t hash; - - hash = hash32_str(str, HASHINIT); - hash = hash32_buf(&len, sizeof(len), hash); - hashtbl[hash & mask] = len; -}</pre> -</div> -</section> -<section class="Sh"> -<h1 class="Sh" id="SEE_ALSO"><a class="permalink" href="#SEE_ALSO">SEE - ALSO</a></h1> -<p class="Pp"><a class="Xr">free(9)</a>, <a class="Xr">hashinit(9)</a>, - <a class="Xr">malloc(9)</a></p> -</section> -<section class="Sh"> -<h1 class="Sh" id="LIMITATIONS"><a class="permalink" href="#LIMITATIONS">LIMITATIONS</a></h1> -<p class="Pp">The <code class="Fn">hash32</code>() functions are only 32 bit - functions. They will prove to give poor 64 bit performance, especially for - the top 32 bits. At the current time, this is not seen as a great - limitation, as these hash values are usually used to index into an array. - Should these hash values be used for other means, this limitation should be - revisited.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="HISTORY"><a class="permalink" href="#HISTORY">HISTORY</a></h1> -<p class="Pp">The <code class="Nm">hash</code> functions first appeared in - <span class="Ux">NetBSD 1.6</span>. The current implementation of - <code class="Nm">hash32</code> functions was first committed to - <span class="Ux">OpenBSD 3.2</span>, and later imported to - <span class="Ux">FreeBSD 6.1</span>. The - <code class="Nm">jenkins_hash</code> functions were added in - <span class="Ux">FreeBSD 10.0</span>. The - <code class="Nm">murmur3_32_hash</code> functions were added in - <span class="Ux">FreeBSD 10.1</span>.</p> -</section> -<section class="Sh"> -<h1 class="Sh" id="AUTHORS"><a class="permalink" href="#AUTHORS">AUTHORS</a></h1> -<p class="Pp">The <code class="Nm">hash32</code> functions were written by - <span class="An">Tobias Weingartner</span>. The - <code class="Nm">jenkins_hash</code> functions were written by - <br/> - <span class="An">Bob Jenkins</span>. The - <code class="Nm">murmur3_32_hash</code> functions were written by - <br/> - <span class="An">Dag-Erling Smørgrav</span> - <<a class="Mt" href="mailto:des@FreeBSD.org">des@FreeBSD.org</a>>.</p> -</section> -</div> -<table class="foot"> - <tr> - <td class="foot-date">June 30, 2015</td> - <td class="foot-os">FreeBSD 15.0</td> - </tr> -</table> |
