Skip to content

Latest commit

 

History

History
44 lines (30 loc) · 1.11 KB

README.md

File metadata and controls

44 lines (30 loc) · 1.11 KB

Petal 🌺

tests

Petal is a Bloom filter in Elixir.

Usage

You can use Petal by adding it to your dependencies in mix.exs:

def deps do
  [
    {:petal, "~> 0.2.1"}
  ]
end

Then within your config file you'll need to specify the hashing implementations to use:

config :petal,
  hashers: [
    Petal.Hasher.Adler32,
    Petal.Hasher.CRC32
  ]

The ones above are included with Petal. You are free to add your own though, just check the documentation for how to implement your own.

You can set the size of the filter with the config setting filter_size:

config :petal,
  filter_size: 64

To calculate what size filter you will need, you can use a handy calculator such as the one here: https://hur.st/bloomfilter.

By default this is set to 64 bits.

Documentation can be generated with ExDoc. The docs can also be found at https://hexdocs.pm/petal.