Update usage notes for [de]serialisation.
This commit is contained in:
parent
318ebca0a8
commit
7100918e36
10
README.md
10
README.md
|
@ -23,6 +23,16 @@ Usage
|
||||||
bloom.test("bar");
|
bloom.test("bar");
|
||||||
bloom.test("blah");
|
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
|
Implementation
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue