Clarification Requested Regarding Bloom Filter Key Check
- Dominant language
- C++
- Stars
- 39.4k
- Forks
- 8.2k
- PR merge metrics
- No merged PRs in 30d
Description
The [Bloom filter](https://github.com/google/leveldb/blob/main/util/bloom.cc#L58) source file includes a check on line 57 that it carries out before doing anything else that causes it to return `false` if the current Bloom filter bit size policy is currently set to anything less than two bytes: 
My question is, is this indeed the intended behavior? The false-positive rate on a Bloom filter will of course improve with additional hash functions, provided the Bloom filter is actually large enough, but if I understand correctly, we don't absolutely *need* multiple hash functions; we could simply use only one. While the usefulness of such a Bloom filter would not be exactly phenomenal, it should still be "correct" (as defined by this weird edge case, since obviously Bloom filters are probabilistic anyways).
Why is it that we carry out this check? Is this just a smoke test making sure we have at least two bytes of data before attempting to check the hash? Is this actually a realistic/historical failure mode?
Contributor guide
Assessment
This issue has not been assessed yet.