aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bloom_filter/bloom.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bloom_filter/bloom.c b/bloom_filter/bloom.c
index ef5c4af..fac6aa9 100644
--- a/bloom_filter/bloom.c
+++ b/bloom_filter/bloom.c
@@ -6,7 +6,7 @@
#define B 14 /* power of */
#define M 16384 /* number of bits */
-#define K 8 /* number of hash varients */
+#define K 8 /* number of hash varients */
static void
print_barray (ub1 * barray)
@@ -31,7 +31,7 @@ bloom_add_check (ub1 * barray, ub1 * key, ub4 len, bool check)
for (i = 0, h = 0; i < K; i++)
{
- h = (hash (key, len, h) & hashmask(10));
+ h = (hash (key, len, h) & hashmask(B));
// printf ("Hashing `%s`, return is: %lu\n", key, h);
if (check)
{