Comments (7)
The simplest thing to do is use JSON.serialize()
. See the unit tests for an example (https://github.com/dsummersl/bloomfilters/blob/master/test/spec/bloomfilterspec.coffee#L130).
I've discussed in the past adding more examples of bson/messagepack/JSON.serialize examples. That kind of thing of interest?
from bloomfilters.
sorry I did not make my use case clear enough: the server side bloom filter code is python. The python bloom filter will provide the bit array as a super long string that looks like '010010010010000001...'
.
I would like to "populate" the client side BloomFilter
with '010010010010000001...'
.
Is this possible?
from bloomfilters.
Ah...I see. It sounds like your python implementation is not a sliced bloom filter, just a plain vanilla bloom filter? That in itself isn't much of a problem in that you could setup a SlicedBloomFilter
with the # of slices equal to 1.
The main problem here really is the hashing function. The HashGenerator
used in this library is built to minimize the number of sha1
calls for performance reasons, and its not pluggable. You will need to match the hashing implementation in python.
We could definitely make the hash generator pluggable - you could then make your own hashing function to match the behavior of your python library.
from bloomfilters.
very good points. thanks.
from bloomfilters.
If you figure out your path lemme know if I can do anything - happy to make the requisite change or accept PRs.
from bloomfilters.
after a bit of experimentation I abandoned the idea of populating the bloomfilter using python and passing the bitarray to the browser - there would be too much work required to add parity between existing python bloom filters and javascript implementations.
Instead I will make a javascript microservice that uses the same blooom filter implementation as the browser, and the values will be passed from python (django) code to the javascript service using a queue. This will simplify things a lot :)
from bloomfilters.
Quite! Glad you figured it out and thanks for the update.
from bloomfilters.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bloomfilters.