BloomFilter

Companion:
class
class Object
trait Matchable
class Any

Value members

Concrete methods

def optimalSize(expectedNumItems: Double, falsePositiveRate: Double): (Int, Int)

Returns the optimal number of buckets (m) and hash functions (k)

Returns the optimal number of buckets (m) and hash functions (k)

The formula is:

val m = ceil(-(n * log(p)) / log(pow(2.0, log(2.0))))
val k = round(log(2.0) * m / n)
def optimallySized[T](expectedNumItems: Double, falsePositiveRate: Double): BloomFilter[T]

Returns a BloomFilter that is optimally sized for the expected number of inputs and false positive rate

Returns a BloomFilter that is optimally sized for the expected number of inputs and false positive rate