Collection of datastructures and algorithims for typescript and javascript.
npm install kolektoCollections and datastructures library for Typescript ( and javascript).
- Installation
- Collections
- BitArray
- BloomFilter
```
npm install kolekto
Import the parts you want.
`typescript
import {BloomFilter} from "kolekto"
let filter = new BloomFilter
`
False positives are possible but false negatives not. In laymen's terms this means that an element maybe be in the set
or definitely not in the set. The underlying hash function is the Google's FarmHash
family of hash functions. By using the the C implementation of farmhash a high insertion can be achieved.
The interface is modeled after the BloomFilter in the Google Guava library.
Example:
`typescript
import {BloomFilter} from "kolekto"
// Create a bloomfilter with 10000 expected insertions and false positive probability of 3%
let filter = new BloomFilter
// Put item in bloomfilter
filter.put("test");
// Check if item is in bloom filter, return true if it might contain element
let result = filter.mightContain("test");
``