]> git.ipfire.org Git - thirdparty/git.git/blobdiff - bloom.h
bloom.c: add the murmur3 hash implementation
[thirdparty/git.git] / bloom.h
diff --git a/bloom.h b/bloom.h
new file mode 100644 (file)
index 0000000..d0fcc5f
--- /dev/null
+++ b/bloom.h
@@ -0,0 +1,13 @@
+#ifndef BLOOM_H
+#define BLOOM_H
+
+/*
+ * Calculate the murmur3 32-bit hash value for the given data
+ * using the given seed.
+ * Produces a uniformly distributed hash value.
+ * Not considered to be cryptographically secure.
+ * Implemented as described in https://en.wikipedia.org/wiki/MurmurHash#Algorithm
+ */
+uint32_t murmur3_seeded(uint32_t seed, const char *data, size_t len);
+
+#endif
\ No newline at end of file