summaryrefslogtreecommitdiff
path: root/core/hashfuncs.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/hashfuncs.h')
-rw-r--r--core/hashfuncs.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/hashfuncs.h b/core/hashfuncs.h
index 6dae82bc55..3b6715a4cd 100644
--- a/core/hashfuncs.h
+++ b/core/hashfuncs.h
@@ -54,9 +54,9 @@ static inline uint32_t hash_djb2(const char *p_cstr) {
return hash;
}
-static inline uint32_t hash_djb2_buffer(uint8_t *p_buff, int p_len) {
+static inline uint32_t hash_djb2_buffer(const uint8_t *p_buff, int p_len,uint32_t p_prev=5381) {
- uint32_t hash = 5381;
+ uint32_t hash = p_prev;
for(int i=0;i<p_len;i++)
hash = ((hash << 5) + hash) + p_buff[i]; /* hash * 33 + c */