Skip to content

Instantly share code, notes, and snippets.

@gauravat16
Created April 18, 2020 16:28
Show Gist options
  • Save gauravat16/aa5cd066aff65c45cf51c2bf4426a816 to your computer and use it in GitHub Desktop.
Save gauravat16/aa5cd066aff65c45cf51c2bf4426a816 to your computer and use it in GitHub Desktop.
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