All Projects → srinivasreddy → rust-bloomfilter

srinivasreddy / rust-bloomfilter

Licence: MIT license
🦀 Bloom filter implementation in Rust 🦀

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to rust-bloomfilter

bloomfilter
Bloomfilter written in Golang, includes rotation and RPC
Stars: ✭ 61 (+238.89%)
Mutual labels:  bloom-filter, probabilistic-data-structures
bloom
An in-memory bloom filter with persistence and HTTP interface
Stars: ✭ 31 (+72.22%)
Mutual labels:  bloom-filter, probabilistic-data-structures
blex
Fast Bloom filter with concurrent accessibility, powered by :atomics module.
Stars: ✭ 34 (+88.89%)
Mutual labels:  bloom-filter, probabilistic-data-structures
exor filter
Erlang nif for xor_filter. 'Faster and Smaller Than Bloom and Cuckoo Filters'.
Stars: ✭ 29 (+61.11%)
Mutual labels:  bloom-filter, probabilistic-data-structures
crlite
WebPKI-level Certificate Revocation via Multi-Level Bloom Filter Cascade
Stars: ✭ 52 (+188.89%)
Mutual labels:  bloom-filter
phpRebloom
🎛️ Use RedisBloom in PHP!
Stars: ✭ 20 (+11.11%)
Mutual labels:  bloom-filter
Abyss
🔬 Assemble large genomes using short reads
Stars: ✭ 219 (+1116.67%)
Mutual labels:  bloom-filter
Python Hashes
Interesting (non-cryptographic) hashes implemented in pure Python.
Stars: ✭ 213 (+1083.33%)
Mutual labels:  bloom-filter
pybloomfiltermmap3
Fast Python Bloom Filter using Mmap
Stars: ✭ 87 (+383.33%)
Mutual labels:  bloom-filter
bloomfilter
Bloom filters for Java
Stars: ✭ 53 (+194.44%)
Mutual labels:  bloom-filter
redisbloom-go
Go Client for RedisBloom probabilistic module
Stars: ✭ 74 (+311.11%)
Mutual labels:  bloom-filter
fever
fast, extensible, versatile event router for Suricata's EVE-JSON format
Stars: ✭ 47 (+161.11%)
Mutual labels:  bloom-filter
cuckoo filter
High-performance, concurrent, and mutable Cuckoo Filter for Erlang and Elixir
Stars: ✭ 31 (+72.22%)
Mutual labels:  bloom-filter
raptor
A fast and space-efficient pre-filter for querying very large collections of nucleotide sequences.
Stars: ✭ 37 (+105.56%)
Mutual labels:  bloom-filter
bloom filter
Bloom filter implementation in Crystal lang
Stars: ✭ 33 (+83.33%)
Mutual labels:  bloom-filter
Libbloom
A simple and small bloom filter implementation in plain C.
Stars: ✭ 215 (+1094.44%)
Mutual labels:  bloom-filter
hackernews-button
Privacy-preserving Firefox extension linking to Hacker News discussion; built with Bloom filters and WebAssembly
Stars: ✭ 73 (+305.56%)
Mutual labels:  bloom-filter
Doramon
个人工具汇总:一致性哈希工具,Bitmap工具,布隆过滤器参数生成器,Yaml和properties互转工具,一键式生成整个前后端工具,单机高性能幂等工具,zookeeper客户端工具,分布式全局id生成器,时间转换工具,Http封装工具
Stars: ✭ 53 (+194.44%)
Mutual labels:  bloom-filter
bloom
Probabilistic set data structure
Stars: ✭ 77 (+327.78%)
Mutual labels:  bloom-filter
ganon
ganon classifies short DNA sequences against large sets of genomic sequences efficiently, with download and update of references (RefSeq/Genbank), taxonomic (NCBI/GTDB) and hierarchical classification, customized reporting and more
Stars: ✭ 57 (+216.67%)
Mutual labels:  bloom-filter

rust-bloomfilter

Bloom filters are defined by 4 interdependent values:

  • n - Number of items in the filter
  • p - Probability of false positives, float between 0 and 1 or a number indicating 1-in-p
  • m - Number of bits in the filter
  • k - Number of hash functions

Guide for selecting the parameters

The values are interdependent as shown in the following calculations:

m = ceil((n * log(p)) / log(1.0 / (pow(2.0, log(2.0)))));

k = round(log(2.0) * m / n);

Design

I use murmur3 hash to generate 128 bit hash integer, and then i split it into two integers of 64 bits each. Following is the pseudo-code written for the design of bloom filter.

let hash_128 = murmur3_hash(data);
let first_64 = (hash_128 & (2_u128.pow(64) - 1));
let second_64 = hash >> 64;
for i 0..num_of_hashfuncs{
    first_64 += i* second_64;
    index =  fist_64 % number_of_bits
    self.bitvec.set(index, true);
}

Usage

extern crate rust_bloomfilter;

use rust_bloomfilter::BloomFilter;

let mut b = BloomFilter(20000, 0.01, true);
b.add("Helloworld");
assert!(b.contains("Helloworld"));
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].