diff --git a/README.md b/README.md index cf3e924..7ac1df2 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,16 @@ Usage bloom.test("bar"); bloom.test("blah"); + // Serialisation. Note that bloom.buckets may be a typed array, + // so we convert to a normal array first. + var array = [].slice.call(bloom.buckets), + json = JSON.stringify(array); + + // Deserialisation. Note that the any array-like object is supported, but + // this will be used directly, so you may wish to use a typed array for + // performance. + var bloom = new BloomFilter(array, 3); + Implementation --------------