From 288143fadff30c9c35e1d458e69ae2ffa0e731af Mon Sep 17 00:00:00 2001 From: Matt Wismer Date: Thu, 22 Jun 2017 21:26:14 -0400 Subject: [PATCH] Correct bloom hash bitpacking documentation The two 12 bit keys add to 24 bits, which leaves 8 bits free in each word. (And 8 * 3 = 24, to pack in the fourth hash.) --- components/selectors/bloom.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/selectors/bloom.rs b/components/selectors/bloom.rs index 8caab9935cb..0e8290fc8c9 100644 --- a/components/selectors/bloom.rs +++ b/components/selectors/bloom.rs @@ -7,7 +7,7 @@ use fnv::FnvHasher; use std::hash::{Hash, Hasher}; -// The top 12 bits of the 32-bit hash value are not used by the bloom filter. +// The top 8 bits of the 32-bit hash value are not used by the bloom filter. // Consumers may rely on this to pack hashes more efficiently. pub const BLOOM_HASH_MASK: u32 = 0x00ffffff; const KEY_SIZE: usize = 12;