jasondavies/bloomfilter.js

Adding filters

semaj opened this issue · 1 comments

semaj commented

If I wanted to combine two filters of the same size, can I get the array forms and add the values at each respective index? (Then reserialize into another filter)

Although I'm not sure what you mean by "reserialize into another filter", yes, you can add two Bloom filters. You will have to add binary values for each index such that:

0 + 0 = 0
0 + 1 = 1
1 + 1 = 1

You also have to keep in mind that, if your Bloom filters weren't created with this in mind, the operation might significantly increase the number of false positives.