Implementing a simple bloom filter in C++.
Branch: master
Clone or download
Pull request Compare This branch is even with olivif:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
BloomFilter.TestApp
BloomFilter
packages
.gitignore
BloomFilter.sln
README.md

README.md

Bloom filter

Overview

This is a c++ implementation of a Bloom Filter. You can read more about the implementation details in the bloom-filter blog post series.

Features

// Put an element into the Bloom filter
void put(std::string input);

// Check if the item is present
// If true - the item *might* be present
// If false - the item is definitely not present
bool isMaybePresent(std::string input) const;

Example

// Create the filter
int size = 10000; // the size of the filter - i.e. number of underlying bits used
int k = 3; // the number of hashing functions to use
auto bloomFilter = BloomFilter(size, k);

// Put items in
bloomFilter.put("ABC");
bloomFilter.put("JKDJKD");
bloomFilter.put("UDIG");

// Check if items are present
bool isMaybePresent;

isMaybePresent = bloomFilter.isMaybePresent("ABC");
isMaybePresent = bloomFilter.isMaybePresent("EFG");

Contributing

For any bugs, questions or contributions, start an issue here.