bloom-filter icon indicating copy to clipboard operation
bloom-filter copied to clipboard

Throws when created for 0 elements

Open golergka opened this issue 4 years ago • 0 comments

Steps to reproduce

import BloomFilter from 'bloom-filter'

BloomFilter.create(0, 0.01)

Expected behaviour

Doesn't throw an error

Actual behaviour

TypeError: Data object should include number of hash functions "nHashFuncs"

Comments

I automatically created bloom filters for set arrays of elements. Sometimes these arrays are empty. It would be nice to handle this edge case without any special logic.

golergka avatar May 19 '21 07:05 golergka