Skip to content

jamesduncombe/petal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Petal is a Bloom filter in Elixir... 🌺

Topics

Resources

License

Stars

Watchers

Forks

Languages