bloom-filter
bloom-filter copied to clipboard
Throws when created for 0 elements
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.