Skip to content

A simple BloomFilter implementation in Java with MurmurHash

Notifications You must be signed in to change notification settings

mausimag/bloomfilter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

A simple BloomFilter implementation in Java with MurmurHash.

More info: https://en.wikipedia.org/wiki/Bloom_filter

New BloomFilter:

BloomFilter bf = new BloomFilter(500, 0.01);

500 is the number of expected elements and 0.01 is the false positive probability that must be between 0 and 1

Main File:

public static void main(String[] args) throws IOException
{
    BloomFilter bf = new BloomFilter(500, 0.01);
    bf.add("www.github.com");
    bf.add("www.google.com");
    bf.add("www.yahoo.com");
    bf.add("www.bing.com");

    System.out.println(bf.contains("www.github.com"));
    System.out.println(bf.contains("www.bing.com"));
    System.out.println(bf.contains("www.ebay.com"));
    System.out.println(bf.contains("www.google.com"));
}

Will result in:

true
true
false
true

About

A simple BloomFilter implementation in Java with MurmurHash

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages