Created
April 18, 2020 16:28
-
-
Save gauravat16/aa5cd066aff65c45cf51c2bf4426a816 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package bloomfilter; | |
import bloomfilter.hash.Murmur3; | |
public class BasicBloomFilter extends AbstractBloomFilter { | |
public BasicBloomFilter(int size) { | |
super(size); | |
} | |
public BasicBloomFilter(double falsePosProbability, int expectedElements) { | |
super(falsePosProbability, expectedElements); | |
} | |
@Override | |
int[] getHashedIndexForBitSet(String data) { | |
return new int[]{Math.abs(data.hashCode()) % bitSet.size(), Math.abs(Murmur3.hash32(data.getBytes())) % bitSet.size(), }; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment