ksm2 / bloom-filter-server

TCP server to store Bloom filter information

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bloom-filter-server

A TCP server to store Bloom filter information written in Rust.

Installation

Install it via Docker:

docker run -it -p 1337:1337 ksm2/bloom-filter-server

The server comes with a very lightweight alpine image (< 10 MB).

Or build it with Rust and Cargo:

cargo run

Usage

Connect to the server e.g. with Telnet:

telnet 127.0.0.1 1337

Then you can run the following commands.

Commands

  • ADD <item1> [<item2>] [<item3>] [...]

    Adds item1... to the Bloom filter.

    The server returns OK. on success.

  • RMV <item1> [<item2>] [<item3>] [...]

    Removes item1 ... from the Bloom filter.

    The server returns OK. on success.

  • HAS <item>

    Checks whether item is contained in the Bloom filter.

    The server returns Yes. if so, or No. otherwise.

  • CNT <item>

    Counts how often item is contained in the Bloom filter.

    The server returns <count>., with count being the count.

  • BIN

    Returns the binary Bloom filter bits.

    The server returns an octet stream of the Bloom filter (fixed to 32 bytes currently).

About

TCP server to store Bloom filter information


Languages

Language:Rust 76.0%Language:JavaScript 18.3%Language:PHP 4.8%Language:Dockerfile 0.9%