Safe and Fast Bloom Filter + FBFs for Erlang
Safe and Fast Bloom Filter + FBFs for Erlang
bloom
)fbf
)mix.exs:
{:erbloom, "~> 2.1.0-rc.2"}
rebar.config:
{erbloom, "2.1.0-rc.2"}
erlang.mk:
dep_erbloom = hex 2.1.0-rc.2
{deps, [
{erbloom, ".*", {git, "https://github.com/Vonmo/erbloom.git", {tag, "v2.0.2"}}}
]}
{ok, Filter} = bloom:new(9585059,1000000).
or filter with wanted rate of false positives:
bloom:new_optimal(1000000, 0.55).
{ok, Filter} = bloom:new_forgetful(BitmapSize, ItemsCount, NumFilters, RotateAfter).
or with fp_rate:
bloom:new_forgetful_optimal(ItemsCount, NumFilters, RotateAfter, FpRate).
bloom:set(Filter, "somekey").
bloom:check(Filter, "anotherkey").
{ok, Binary} = bloom:serialize(Filter).
bloom:deserialize(Binary).
make build_imgs
- build docker imagesmake up
- run sandboxmake down
- terminate sandboxmake tests
- run testsmake lint
- lintermake xref
- xref analysismake prod
- generate release for targetmake doc
- generate documentation from EDocWithout docker you must install erlang >=20.1 and rust >=1.23 on your machine. After you can run these goals:
release:
rebar3 as prod release
test:
rebar3 as test ct