best-for-bloom
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Best For Bloom Travis CI Build Status

Calculate amount of bits and hash functions based on the amount of items and the probability of false positives.

NPM Badge

Install

npm install best-for-bloom

Usage

const bestForBloom = require("best-for-bloom");
 
bestForBloom(100000, 1e-6)
//=> { bits: 2875518, hash: 20 }

API

bestForBloom(items, probability)

items

Type: number

Number of items in the filter.

probability

Type: number

Probability of false positives, decimal between 0 and 1. Default is 1e-7 (1 in 1 million).

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i best-for-bloom

    Weekly Downloads

    0

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    3.77 kB

    Total Files

    6

    Last publish

    Collaborators

    • richienb