aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/hash.h
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2012-09-04 12:07:33 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2012-09-04 12:07:33 +0000
commit62208ca5d21b28478785b638e5af081314dec5bc (patch)
tree5a56f4d78ed7c2807e5e36a0c7f511f72811d98f /sys/sys/hash.h
parente99fc4b0f80494edd66e5f3ab60617c4a11ab6c2 (diff)
downloadsrc-62208ca5d21b28478785b638e5af081314dec5bc.tar.gz
src-62208ca5d21b28478785b638e5af081314dec5bc.zip
- 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
Notes
Notes: svn path=/head/; revision=240086
Diffstat (limited to 'sys/sys/hash.h')
-rw-r--r--sys/sys/hash.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/sys/sys/hash.h b/sys/sys/hash.h
index 6ad89c5ef905..ca9cc6789f02 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_ */