SkillAgentSearch skills...

DlCBF

d-left Counting Bloom Filter

Install / Use

/learn @seiflotfy/DlCBF
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

dlCBF

GoDoc

A d-left Counting Bloom Filter (dlCBF) is simple hashing-based Counting Bloom Filter (CBF) alternative based on d-left hashing that offers the same functionality as a CBF, but uses less space, generally saving a factor of two or more.

For details about the algorithm and citations please use this article for now

"Bloom Filters via d-Left Hashing and Dynamic Bit Reassignment Extended Abstract" by Flavio Bonomi, Michael Mitzenmacher, Rina Panigrahy, Sushil Singh and George Varghese

Note:
  • This implmentation currently does not implement the counter feature. (coming soon)
  • Insertions of items that already exists in the filter will fail (item can only exist once).
  • fingerprint size set to a static 16 Bit (also to be changed soon)

Usage

dlcbf, err := NewDlcbfForCapacity(1000000)
	
// Add Item
dlcbf.Add("jon snow is alive")

count := dlcbf.GetCount() // count >> 1

member := dlcbf.IsMember("jon snow is alive") // member = true
	
// Remove Item
dlcbf.Delete("jon snow is alive") // returns true

// Remove Item again
dlcbf.Delete("jon snow is alive") // returns false
	
count := dlcbf.GetCount() // count >> 0
View on GitHub
GitHub Stars56
CategoryDevelopment
Updated3y ago
Forks6

Languages

Go

Security Score

80/100

Audited on Mar 7, 2023

No findings