Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andreasgassmann/bloom-filter
Bloom filter
https://github.com/andreasgassmann/bloom-filter
Last synced: 8 days ago
JSON representation
Bloom filter
- Host: GitHub
- URL: https://github.com/andreasgassmann/bloom-filter
- Owner: AndreasGassmann
- Created: 2015-11-18T15:57:47.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2015-12-04T08:03:00.000Z (almost 9 years ago)
- Last Synced: 2023-03-08T11:08:29.956Z (over 1 year ago)
- Language: Java
- Homepage:
- Size: 3.61 MB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bloom-Filter
A small open-source implementation of a bloom-filter in Java. This filter can only be used with text-files that contain one word per line.### Use
The constructor of the Bloom-Filter expects two arguments: the number of elements as well as the desired error-probability (passed as a number between 0 and 1).Example:
```
BloomFilter bf = new BloomFilter(58111, 0.05);
```
Out of these two values, the Bloom-Filter calculates automatically the optimal number of required Hashing-Functions and the optimal size of the data-structure.To fill the data-strucutre of the bloom-filter, iterate over all the strings to add to the data-structure and use the 'addToFilter(String s)'-Function like this:
```
Files.lines(path).forEach(s -> bf.addToFilter(s));
```To check if a given value already exists in the data-structure use the function 'checkIfExists(String StringToCheck)' like this:
```
bf.checkIfExists((String) s);
```