diff options
author | glebius <glebius@FreeBSD.org> | 2012-09-04 12:07:33 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2012-09-04 12:07:33 +0000 |
commit | 0259eae71ddeae3d8d755dc42bbdc21e1016da04 (patch) | |
tree | 5a56f4d78ed7c2807e5e36a0c7f511f72811d98f /sys/sys/hash.h | |
parent | 7b532e0b89fb03edc5e4dbadf4ce2ac072c67d70 (diff) | |
download | FreeBSD-src-0259eae71ddeae3d8d755dc42bbdc21e1016da04.zip FreeBSD-src-0259eae71ddeae3d8d755dc42bbdc21e1016da04.tar.gz |
- Move jenkins.h to jenkins_hash.c
- Provide missing function that can do hashing of arbitrary sized buffer.
- Refetch lookup3.c and do only minimal edits to it, so that diff between
our jenkins_hash.c and lookup3.c is minimal.
- Add declarations for jenkins_hash(), jenkins_hash32() to sys/hash.h.
- Document these functions in hash(9)
Obtained from: http://burtleburtle.net/bob/c/lookup3.c
Diffstat (limited to 'sys/sys/hash.h')
-rw-r--r-- | sys/sys/hash.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/sys/hash.h b/sys/sys/hash.h index 6ad89c5..ca9cc67 100644 --- a/sys/sys/hash.h +++ b/sys/sys/hash.h @@ -118,4 +118,13 @@ hash32_strne(const void *buf, size_t len, int end, const char **ep, return hash; } + +#ifdef _KERNEL +/* + * Hashing function from Bob Jenkins. Implementation in libkern/jenkins_hash.c. + */ +uint32_t jenkins_hash(const void *, size_t, uint32_t); +uint32_t jenkins_hash32(const uint32_t *, size_t, uint32_t); +#endif /* _KERNEL */ + #endif /* !_SYS_HASH_H_ */ |