All Projects → jbapple → libfilter

jbapple / libfilter

Licence: Apache-2.0 license
High-speed Bloom filters and taffy filters for C, C++, and Java

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language
java
68154 projects - #9 most used programming language
Makefile
30231 projects
python
139335 projects - #7 most used programming language
go
31211 projects - #10 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to libfilter

bloom
An in-memory bloom filter with persistence and HTTP interface
Stars: ✭ 31 (+34.78%)
Mutual labels:  bloom-filters, bloom-filter, bloomfilter
hackernews-button
Privacy-preserving Firefox extension linking to Hacker News discussion; built with Bloom filters and WebAssembly
Stars: ✭ 73 (+217.39%)
Mutual labels:  bloom-filters, bloom-filter
bloomfilter
Bloom filters for Java
Stars: ✭ 53 (+130.43%)
Mutual labels:  bloom-filters, bloom-filter
fastbloom
A simple but fast bloomfilter written in Python
Stars: ✭ 21 (-8.7%)
Mutual labels:  bloom-filter, bloomfilter
blex
Fast Bloom filter with concurrent accessibility, powered by :atomics module.
Stars: ✭ 34 (+47.83%)
Mutual labels:  bloom-filter
bloofi
Bloofi: A java implementation of multidimensional Bloom filters
Stars: ✭ 68 (+195.65%)
Mutual labels:  bloom-filters
Olivia
Go: A distributed, in-memory key-value storage.
Stars: ✭ 94 (+308.7%)
Mutual labels:  bloom-filters
Abyss
🔬 Assemble large genomes using short reads
Stars: ✭ 219 (+852.17%)
Mutual labels:  bloom-filter
cuckoo filter
High-performance, concurrent, and mutable Cuckoo Filter for Erlang and Elixir
Stars: ✭ 31 (+34.78%)
Mutual labels:  bloom-filter
exor filter
Erlang nif for xor_filter. 'Faster and Smaller Than Bloom and Cuckoo Filters'.
Stars: ✭ 29 (+26.09%)
Mutual labels:  bloom-filter
ntEdit
✏️ultra fast and scalable genome assembly polishing
Stars: ✭ 56 (+143.48%)
Mutual labels:  bloom-filter
Doramon
个人工具汇总:一致性哈希工具,Bitmap工具,布隆过滤器参数生成器,Yaml和properties互转工具,一键式生成整个前后端工具,单机高性能幂等工具,zookeeper客户端工具,分布式全局id生成器,时间转换工具,Http封装工具
Stars: ✭ 53 (+130.43%)
Mutual labels:  bloom-filter
bloom
Bloom filter for go, backed by redis
Stars: ✭ 37 (+60.87%)
Mutual labels:  bloom-filters
bloom
Go package implementing Bloom filters
Stars: ✭ 1,752 (+7517.39%)
Mutual labels:  bloom-filters
js-data-structures
🌿 Data structures for JavaScript
Stars: ✭ 56 (+143.48%)
Mutual labels:  bloom-filters
fever
fast, extensible, versatile event router for Suricata's EVE-JSON format
Stars: ✭ 47 (+104.35%)
Mutual labels:  bloom-filter
phpRebloom
🎛️ Use RedisBloom in PHP!
Stars: ✭ 20 (-13.04%)
Mutual labels:  bloom-filter
bloom
Probabilistic set data structure
Stars: ✭ 77 (+234.78%)
Mutual labels:  bloom-filter
bloomfilter
bloomfilter.js ported to Go
Stars: ✭ 94 (+308.7%)
Mutual labels:  bloom-filters
crlite
WebPKI-level Certificate Revocation via Multi-Level Bloom Filter Cascade
Stars: ✭ 52 (+126.09%)
Mutual labels:  bloom-filter

This repository provides implementations of various Bloom filters and taffy filters for C, C++, Java, Python, and Go.

If you need a basic filter and you know ahead of time which keys will be in it, use a static filter.

If you don't know what the keys will be, but you know approximately how many there are, use a block filter.

Otherwise, use a taffy filter, which can grow as you add more keys to it.

Example usage of block filter in C:

#include <filter/block.h>

unsigned ndv = 1000000;
double fpp = 0.0065;
uint64_t hash = 0xfeedbadbee52b055;

libfilter_block filter;

unsigned bytes = libfilter_block_bytes_needed(ndv, fpp);
libfilter_block_init(bytes, &filter);
libfilter_block_add_hash(hash, &filter);
assert(libfilter_block_find_hash(hash, &filter));
libfilter_block_destruct(&filter);

in C++:

#include <filter/block.hpp>

unsigned ndv = 1000000;
double fpp = 0.0065;
uint64_t hash = 0xfeedbadbee52b055;

auto filter = filter::BlockFilter::CreateWithNdvFpp(ndv, fpp);
filter.InsertHash(hash);
assert(filter.FindHash(hash));

in Java

import com.github.jbapple.libfilter.BlockFilter;

int ndv = 1000000;
double fpp = 0.0065;
long hash = (((long) 0xfeedbadb) << 32) | (long) 0xee52b055;

BlockFilter = BlockFilter.CreateWithNdvFpp(ndv, fpp);
filter.AddHash64(hash);
assert filter.FindHash64(hash)

in Go

import ("github.com/jbapple/libfilter")

b := NewBlockFilter(BlockBytesNeeded(1000000, 0.0065))
var hash uint64
hash = 0xfeedbadbee52b055
b.AddHash(hash)
if !b.FindHash(hash) {
    panic("uhoh!")
}

in Python

import block

b = block.Block(1000000, 0.0065)
hash = 0xfeedbadbee52b055
b += hash
assert (hash in b)

To install:

make
# probably needs a sudo:
make install
make java-world
mvn -f ./java/ install -Dmaven.test.skip=true
[optional: copy java/target/libfilter-*.jar to your classpath]
make python-world
make go-world

The C and C++ libraries can also be installed with CMake:

cmake -B build -S . -DCMAKE_INSTALL_PATH=<where/to/install>
cmake --build build
# probably needs a sudo:
cmake --install build

The library targets are exported and can be used in CMakeLists.txt:

find_package(libfilter)
# The C API:
target_link_libraries(mylib PRIVATE libfilter::c)
# The C++ API:
target_link_libraries(mylib PRIVATE libfilter::cxx)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].