jasondavies / bloomfilter.js

JavaScript bloom filter using FNV for fast hashing
http://www.jasondavies.com/bloomfilter/
BSD 3-Clause "New" or "Revised" License
759 stars 79 forks source link

Create function to serialize/deserialize bloom filter #2

Closed Glench closed 11 years ago

Glench commented 12 years ago

Given the standalone nature of your bloomfilter, I was wondering if it would make sense to serialize/deserialize the bloomfilter bytearray/array.

My use case is that I'm trying to send a dictionary to the front-end to see if words the user types in are in it. I thought it might be faster/smaller to store the dictionary in a bloomfilter.

jasondavies commented 12 years ago

Another good idea, thanks! We either need to allow a bloom filter to be constructed for a given byte array, or add serialisation/deserialisation support directly. A byte array is preferable, so that you could use any encoding you wanted over the wire (base64 &c.)