Open fankeke opened 5 years ago
https://github.com/tivvit/pure-lua-bloom-filter/blob/14bc42e9f4147c5f28c5f9b486f4ed4c24e50e53/bloom_filter.lua#L96
should be
for i = 0, self.bits do --> for i = 0, self.bytes do
https://github.com/tivvit/pure-lua-bloom-filter/blob/14bc42e9f4147c5f28c5f9b486f4ed4c24e50e53/bloom_filter.lua#L42
start for `1` would be better for i = 1, self.bytes do 【same above】
another one:
local b = xxh32(val, i) % self.bits;
local b = xxh32(val, string.len(val), i) % self.bits;
https://github.com/tivvit/pure-lua-bloom-filter/blob/14bc42e9f4147c5f28c5f9b486f4ed4c24e50e53/bloom_filter.lua#L96
should be
https://github.com/tivvit/pure-lua-bloom-filter/blob/14bc42e9f4147c5f28c5f9b486f4ed4c24e50e53/bloom_filter.lua#L42