# cuckoo-filter-ts

> Cuckoo Filter: Practically Better Than Bloom

Latest version **1.4.0** (published 2017-11-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install cuckoo-filter-ts
pnpm add cuckoo-filter-ts
yarn add cuckoo-filter-ts
bun add cuckoo-filter-ts
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.4.0 |
| Published | 2017-11-04 |
| First published | 2017-11-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=4 |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Devan Patel |
| Maintainers | devanp92 |
| Keywords | typescript, cuckoo-filter, data-structures, algorithms, javascript, es6 |

## Links

- npm: https://www.npmjs.com/package/cuckoo-filter-ts
- Repository: https://github.com/devanp92/cuckoo-filter-ts
- Homepage: https://github.com/devanp92/cuckoo-filter-ts#readme
- Issues: https://github.com/devanp92/cuckoo-filter-ts/issues
- npm.io page: https://npm.io/package/cuckoo-filter-ts

## Dependencies (2)

- [tslib](https://npm.io/package/tslib.md) ^1.6.0
- [murmurhash3](https://npm.io/package/murmurhash3.md) ^0.4.0

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.4.0 (latest) — 2017-11-04

## README

# Cuckoo Filter

Typescript implementation of a Cuckoo Filter.

### Introduction

A [Cuckoo Filter](https://www.cs.cmu.edu/~dga/papers/cuckoo-conext2014.pdf) is a probabilistic data structure that is used for set membership. It is built with the fundamentals of a [Bloom Filter](https://en.wikipedia.org/wiki/Bloom_filter) though offers four advantages over the Bloom Filter (as cited in the documented paper):

1. Dynamic `add` and `delete`
2. Faster lookup time
3. Easier to implement
4. Uses less space (if the target false positive rate is less than 3%)

### Description

A Cuckoo Filter is comprised of a `n` of buckets where each bucket can store `m` `k`-bit sized fingprints. When inserting an object into the filter, it firsts creates a fingerprint, using [MurmurHash3](https://en.wikipedia.org/wiki/MurmurHash), then determines two buckets the fingerprint can be stored in. If either one of the buckets has space, it will be inserted into one of the two. If not, it will evict fingerprints and swap them with different buckets. This process can occur up to a configurable number of times.

Similar to a Bloom Filter, the Cuckoo Filter will determine if an object **might** be stored or is **definitely not** stored. There can be an issue with the aforementioned fourth advantage, where an existing fingerprint is inserted into the filter.

### Installing

```
yarn
```

## Running the tests

```
yarn run build
yarn run unit
```

## License

This project is licensed under the MIT License - see the [LICENSE.md](https://github.com/devanp92/cuckoo-filter-ts/blob/master/LICENSE) file for details

## Acknowledgments

* Authors of [Cuckoo Filter](https://www.cs.cmu.edu/~dga/papers/cuckoo-conext2014.pdf)

---
_Source: https://npm.io/package/cuckoo-filter-ts · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
