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
import math | |
import mmh3 | |
from bitarray import bitarray | |
class BloomFilter(object): | |
def __init__(self, items_count, fp_prob): | |
self.fp_prob = fp_prob | |
self.size = self.get_size(items_count, fp_prob) | |
self.hash_count = self.get_hash_count(self.size, items_count) | |
self.bit_array = bitarray(self.size) |
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
IN WINDOWS DEFAULTS TO .xml | |
abc -> abc.xml correct | |
abc. -> abc..xml correct | |
abc, -> abc,.xml correct | |
abc.ssrf -> abc.ssrf correct | |
abc..ssrf -> abc..ssrf correct | |
abc,ssrf -> abc,ssrf.xml correct | |
abc,.ssrf -> abc,.ssrf correct | |
abc.,ssrf -> abc.,ssrf.xml correct | |
abc.xml -> abc.xml correct |