-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Here's the code:
filter = BloomFilter.new size: 100_000, error_rate: 0.00001
100_000.times do
filter.insert "#{rand(1..1_000_000)}"
end
filter.dump "hii"
Now when I do:
filter = BloomFilter.load "hii"
I get:
in `load': unable to load BloomFilter, expected 299534 but got 420 bytes (StandardError)
I'm supposing this has to do with the operating system, I'm using Windows 7, and it prob has to do with it having 2 ways to load/save files to disk (text/binary mode).
I actually had the same problem with bloomfilter-rb and I fixed it by forcing File.open to write and read in binary mode (it was as easy as appending "b" to the "r" and "w" modes). But here I see the code for serialization is written in C, so that wouldn't be possible.
Metadata
Metadata
Assignees
Labels
No labels