tasuki/elm-bloom - version: 1.0.0

for more information visit the package's GitHub page

Package contains the following modules:

elm-bloom: Bloom Filter for Elm

Elm Bloom filter implementation using Murmur3. It may not be the fastest implementation, but it is simple and easy to use. This blog post with rules of thumb for choosing m and k might be helpful.

Installation

elm package install ggb/elm-bloom

Usage

Usage is straightforward:

import Bloom exposing (empty, add, test)

-- create an empty filter with m elements and k hashes
emptyFilter = empty 1000 4

-- add elements to the filter
filter = 
  List.foldr 
    add
    emptyFilter 
    ["foo", "bar", "baz", ... ]

-- check if elements are recognized by the filter
test "bar" filter == True
test "barr" filter == False