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.)
This commit is contained in:
Matt Wismer 2017-06-22 21:26:14 -04:00 committed by GitHub
parent efed75ae5a
commit 288143fadf

View file

@ -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;