This file contains hidden or 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
| #!/usr/bin/env python | |
| """A simple Bloom Filter implementation | |
| Calculating optimal filter size: | |
| Where: | |
| m is: self.bitcount (how many bits in self.filter) | |
| n is: the number of expected values added to self.filter | |
| k is: the number of hashes being produced | |
| (1 - math.exp(-float(k * n) / m)) ** k | |
| http://en.wikipedia.org/wiki/Bloom_filter | |
| """ |