ethereum-bloom-filters
ethereum-bloom-filters copied to clipboard
How do you create a bloom filter and add elements to it?
I only see functions to perform checks on a bloom filter, but no functions to create one and add elements to it. Not sure how I'd be able to use the library without a bloom filter in the first place. Does solidity or web3 provide bloom filter primitives?
Hey @gubatron thanks a lot for raising this issue. The library was initially created for easy looks ups from “logBlooms” and topic blooms which are returned on blocks from Ethereum itself (so ethereum give you the blooms). This libs functions are used in big ethereum libraries like web3js as utils for developers to query data against the blooms given to them on every new block. So it only exposes functions which you pass it a value and a bloom and it tells you if it exists in that bloom filter or not.
Happy to extend this library to have ability to create a new bloom, add to it and remove elements from it for sure. Is that something you would like to see in this library?
I’m on vacation till Monday but will look when back. Let me know if you would like to see anymore then:
- create new bloom filter
- ability to add a value to the bloom
- ability to remove a value to the bloom
Thanks 👍