Pacote
    Preparing search index...

    Function optimal

    • Calculates Bloom filter size and hash count for a target item count and false positive rate.

      Parameters

      • items: number

        Expected number of items in the filter.

      • errorRate: number

        Desired false positive probability, between 0 and 1.

      Returns Options

      The filter size in bits and the number of hashes to use.

      import { optimal } from '@pacote/bloom-filter'

      const options = optimal(1000, 0.01)