Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modification of Bit Manipulation in Bloom Filter #1217

Open
khobaib529 opened this issue Dec 11, 2024 · 0 comments
Open

Modification of Bit Manipulation in Bloom Filter #1217

khobaib529 opened this issue Dec 11, 2024 · 0 comments

Comments

@khobaib529
Copy link

File: util/bloom.cc
Line: 50: array[bitpos / 8] |= (1 << (bitpos % 8));
This line sets the bit at position n by shifting 1 left by the remainder of n divided by 8. However, it does not set the nth bit directly; instead, it sets the bit at position (n / 8) * 8 + (8 - n % 8).
According to standard Bloom filter logic, we should set the nth bit (where n is calculated by hashing the key). While the current implementation functions correctly, aligning with traditional Bloom filter logic could enhance clarity. However, if this is changed to align with the original implementation of Bloom filters, existing databases may encounter issues such as data loss or incorrect results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant