aboutsummaryrefslogtreecommitdiff
path: root/hash/hash_func.go
diff options
context:
space:
mode:
Diffstat (limited to 'hash/hash_func.go')
-rw-r--r--hash/hash_func.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/hash/hash_func.go b/hash/hash_func.go
new file mode 100644
index 0000000..853412b
--- /dev/null
+++ b/hash/hash_func.go
@@ -0,0 +1,9 @@
+package hash
+
+func defaultHash(key []byte) uint32 {
+ var h uint32
+ for _, v := range key {
+ h = (h << 5) + h + uint32(v)
+ }
+ return h
+}