public void CheckParameterCalculation(long expectedItems, long errorRate, int expectedNumBits, int expectedNumHashFunctions) { IBloomFilterParameters parameters = BloomUtils.CalculateBloomParameters(expectedItems, errorRate); Assert.AreEqual(expectedNumBits, parameters.NumberOfBits); Assert.AreEqual(expectedNumHashFunctions, parameters.NumberOfHashFunctions); CheckErrorRate(expectedItems, errorRate, parameters); }
private static long CalculateErrorRate(long expectedItems, IBloomFilterParameters parameters) { double calcErrorRate = BloomUtils.CalculateErrorRate(expectedItems, parameters); return(Convert.ToInt64(1 / calcErrorRate)); }