# golombcodedsets-with-base64

> Golomb-coded sets (GCS) is a probabilistic data structure conceptually similar to the famous Bloom filters, but with a more compact in-memory representation, and a slower query time.

Latest version **0.0.4** (published 2017-06-28) · http://unlicense.org/ license · 0 weekly downloads

## Install

```sh
npm install golombcodedsets-with-base64
pnpm add golombcodedsets-with-base64
yarn add golombcodedsets-with-base64
bun add golombcodedsets-with-base64
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2017-06-28 |
| First published | 2017-06-23 |
| Weekly downloads | 0 |
| License | http://unlicense.org/ |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Giovanni Bajo, Miel Vander Sande, Poyu Chen |
| Maintainers | poyu |
| Keywords | approximate, membership, query, data, structure, bloom, filter |

## Links

- npm: https://www.npmjs.com/package/golombcodedsets-with-base64
- Repository: https://github.com/applefreak/golombcodedsets.js
- Issues: https://github.com/applefreak/golombcodedsets.js/issues
- npm.io page: https://npm.io/package/golombcodedsets-with-base64

## Dependencies (1)

- [murmurhash](https://npm.io/package/murmurhash.md) 0.0.2

## Alternatives

- [gamedig](https://npm.io/package/gamedig.md) — 29.3K weekly downloads
- [join-monster](https://npm.io/package/join-monster.md) — 12.8K weekly downloads
- [masked](https://npm.io/package/masked.md) — 5.5K weekly downloads
- [@comunica/actor-query-process-explain-logical](https://npm.io/package/@comunica/actor-query-process-explain-logical.md) — 4.7K weekly downloads
- [@veracity/vui](https://npm.io/package/@veracity/vui.md) — 4.6K weekly downloads

## Recent versions

- 0.0.4 (latest) — 2017-06-28
- 0.0.3 — 2017-06-23
- 0.0.2 — 2017-06-23

## README

# golombcodedsets.js

This is an NPM package with a refactored version of https://github.com/rasky/gcs

```javascript
const gcs = require('golombcodedsets');

const builder = new gcs.GCSBuilder(20, 10);

console.log('Adding "item1" & "item2"')
builder.add('item1')
builder.add('item2')

const hash = builder.toBase64()

console.log('base64 representation of the set:', hash)

const query = new gcs.GCSQuery(hash)

console.log('Checking "item2":', query.query('item2'))
console.log('Checking "item3":', query.query('item3'))
```

# Custom hash functions

The default are the 32 least significant bits of a md5 hash;
Using murmurhash (default now) instead:

```javascript
const murmurhash = require('murmurhash');

const builder = new gcs.GCSBuilder(numberOfItems, error_probability, murmurhash.v3);
const query = new gcs.GCSQuery(arrayBuffer, murmurhash.v3);
```

Parameter of the hash function should be a string, while the output is an integer.

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