Manual Reference Pages - HASH (9)
- general kernel hashing functions
hash32_buf const void *buf size_t len uint32_t hash
hash32_str const void *buf uint32_t hash
hash32_strn const void *buf size_t len uint32_t hash
hash32_stre const void *buf int end const char **ep uint32_t hash
hash32_strne const void *buf size_t len int end const char **ep uint32_t hash
jenkins_hash const void *buf size_t len uint32_t hash
jenkins_hash32 const uint32_t *buf size_t count uint32_t hash
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
terminated strings, as well as blocks of memory.
function is used as a general buffer hashing function.
is used to pass in the location, and
is the length of the buffer.
is used to extend an existing hash, or is passed the initial value
to start a new hash.
function is used to hash a
terminated string passed in
with initial hash value given in
function is like the
function, except it also takes a
argument, which is the maximal length of the expected string.
functions are helper functions used by the kernel to hash pathname
These functions have the additional termination condition
of terminating when they find a character given by
in the string to be hashed.
If the argument
it is set to the point in the buffer at which the hash function
function has same semantics as the
but provides more advanced hashing algorithm with better distribution.
uses same hashing algorithm as the
function, but works only on
sized arrays, thus is simplier and faster.
It accepts an array of
values in its first argument and size of this array in the second argument.
functions return a 32 bit hash value of the buffer or string.
LIST_HEAD(head, cache) *hashtbl = NULL;
u_long mask = 0;
hashtbl = hashinit(numwanted, type, flags, &mask);
sample_use(char *str, int len)
hash = hash32_str(str, HASHINIT);
hash = hash32_buf(&len, sizeof(len), hash);
hashtbl[hash & mask] = len;
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
functions first appeared in
.Nx 1.6 .
The current implementation of
functions was first committed to
.Ox 3.2 ,
and later imported to
.Fx 6.1 .
functions were added in
.Fx 10.0 .
functions were written by
.An Tobias Weingartner .
functions was written by
Bob Jenkins .
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.