Git Product home page Git Product logo

Comments (7)

dsummersl avatar dsummersl commented on June 11, 2024

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.

richtier avatar richtier commented on June 11, 2024

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.

dsummersl avatar dsummersl commented on June 11, 2024

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.

richtier avatar richtier commented on June 11, 2024

very good points. thanks.

from bloomfilters.

dsummersl avatar dsummersl commented on June 11, 2024

If you figure out your path lemme know if I can do anything - happy to make the requisite change or accept PRs.

from bloomfilters.

richtier avatar richtier commented on June 11, 2024

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.

dsummersl avatar dsummersl commented on June 11, 2024

Quite! Glad you figured it out and thanks for the update.

from bloomfilters.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.