summaryrefslogtreecommitdiff
path: root/src/libstddjb/cdb_hashadd.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-07-03 11:10:09 +0000
committerLaurent Bercot <ska@appnovation.com>2023-07-03 11:10:09 +0000
commit0beff2477b55728603127f21a9df604b6fcf840c (patch)
tree2d13673355974d9c74dc46b2dd84231c5b744f2e /src/libstddjb/cdb_hashadd.c
parent109417b5defcd6d13c54b213c4f06272fcf0dc19 (diff)
downloadskalibs-0beff2477b55728603127f21a9df604b6fcf840c.tar.xz
Refactor cdbmake, add cdbmake_addv, cdb_hashv
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/libstddjb/cdb_hashadd.c')
-rw-r--r--src/libstddjb/cdb_hashadd.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libstddjb/cdb_hashadd.c b/src/libstddjb/cdb_hashadd.c
new file mode 100644
index 0000000..426fb95
--- /dev/null
+++ b/src/libstddjb/cdb_hashadd.c
@@ -0,0 +1,9 @@
+/* ISC license. */
+
+#include "cdb-internal.h"
+
+uint32_t cdb_hashadd (uint32_t h, uint8_t c)
+{
+ h += (h << 5) ;
+ return h ^ c ;
+}