Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gmcabrita/cuckoo
:bird: Cuckoo Filters in Elixir
https://github.com/gmcabrita/cuckoo
cuckoo-filter data-structures elixir hex probabilistic-data-structures
Last synced: 3 days ago
JSON representation
:bird: Cuckoo Filters in Elixir
- Host: GitHub
- URL: https://github.com/gmcabrita/cuckoo
- Owner: gmcabrita
- License: mit
- Archived: true
- Created: 2014-11-26T23:05:17.000Z (almost 10 years ago)
- Default Branch: main
- Last Pushed: 2021-06-08T19:02:07.000Z (over 3 years ago)
- Last Synced: 2024-10-06T03:57:51.029Z (29 days ago)
- Topics: cuckoo-filter, data-structures, elixir, hex, probabilistic-data-structures
- Language: Elixir
- Homepage:
- Size: 83 KB
- Stars: 42
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - A pure Elixir implementation of [Cuckoo Filters](https://www.cs.cmu.edu/%7Edga/papers/cuckoo-conext2014.pdf). (Algorithms and Data structures)
- fucking-awesome-elixir - cuckoo - A pure Elixir implementation of [Cuckoo Filters](https://www.cs.cmu.edu/%7Edga/papers/cuckoo-conext2014.pdf). (Algorithms and Data structures)
- awesome-elixir - cuckoo - A pure Elixir implementation of [Cuckoo Filters](https://www.cs.cmu.edu/%7Edga/papers/cuckoo-conext2014.pdf). (Algorithms and Data structures)
README
Cuckoo
======[![Build Status](https://img.shields.io/github/workflow/status/gmcabrita/cuckoo/CI/master.svg)](https://github.com/gmcabrita/cuckoo/actions)
[![Coverage Status](https://img.shields.io/coveralls/gmcabrita/cuckoo.svg?style=flat)](https://coveralls.io/r/gmcabrita/cuckoo?branch=master)
[![Hex docs](http://img.shields.io/badge/hex.pm-docs-green.svg?style=flat)](https://hexdocs.pm/cuckoo)
[![Hex Version](http://img.shields.io/hexpm/v/cuckoo.svg?style=flat)](https://hex.pm/packages/cuckoo)
[![License](http://img.shields.io/hexpm/l/cuckoo.svg?style=flat)](https://github.com/gmcabrita/cuckoo/blob/master/LICENSE)Cuckoo is a pure Elixir implementation of a [Cuckoo Filter](https://www.cs.cmu.edu/~dga/papers/cuckoo-conext2014.pdf).
# Usage
Add Cuckoo as a dependency in your mix.exs file.
```elixir
def deps do
[{:cuckoo, "~> 1.0"}]
end
```# Examples
```iex
iex> cf = Cuckoo.new(1000, 16, 4)
%Cuckoo{...}iex> {:ok, cf} = Cuckoo.insert(cf, 5)
%Cuckoo{...}iex> Cuckoo.contains?(cf, 5)
trueiex> {:ok, cf} = Cuckoo.delete(cf, 5)
%Cuckoo{...}iex> Cuckoo.contains?(cf, 5)
false
```# Implementation Details
The implementation follows the specification as per the paper above.
For hashing we use the x64_128 variant of Murmur3 and the Erlang phash2.