Double hashing derives several positions from two base hash results. In a Bloom filter, it avoids maintaining many independent hash implementations while producing the bit indices needed for insertion and lookup. section 4.5 section 4.6.3
A practical construction proceeds as follows:
- Hash the key with MurmurHash32 and FNV-1 to obtain hM and hF. section 4.6.3
- For each index i from 0 through k−1, compute hi(hM, hF) = (hM + i × hF + i²) mod m. section 4.5 section 4.6.4
- Use the resulting k positions to set or inspect bits; retain a seed when deterministic tests, serialization, or restart behavior matter. section 4.6.3
Bloom-filter position generation
Given two base hashes, the initialized function for i = 2 returns (hM + 2hF + 4) mod m. Repeating this for every i produces the bit positions for one key. section 4.5 section 4.6.4
