# Python Implementation of the Ethereum Bloom Filter
`shell $ pip install ethereum-bloom `
## Usage
`python >>> from eth_bloom import BloomFilter >>> b = BloomFilter() >>> b = BloomFilter() >>> b'a value' in b False >>> b.add(b'a value') >>> b'a value' in b True >>> int(b) 3458628712844765018311492773359360516229024449585949240367644166080576879632652362184119765613545163153674691520749911733485693171622325900647078772681584616740134230153806267998022370194756399579977294154062696916779055028045657302214591620589415314367270329881298073237757853875497241510733954508399863880080986777555986663988492288946856978031023631618215522505971170427986911575695114157059398791122395379400594948096 >>> bin(b) '0b100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' `
You can also merge bloom filters
`python >>> from eth_bloom import BloomFilter >>> b1 = BloomFilter() >>> b2 = BloomFilter() >>> b1.add(b'a') >>> b1.add(b'common') >>> b2.add(b'b') >>> b2.add(b'common') >>> b'a' in b1 True >>> b'b' in b1 False >>> b'common' in b1 True >>> b'a' in b2 False >>> b'b' in b2 True >>> b'common' in b2 True >>> b3 = b1 + b2 # using addition >>> b'a' in b3 True >>> b'b' in b3 True >>> b'common' in b3 True >>> b4 = b1 | b2 # or using bitwise or >>> b'a' in b4 True >>> b'b' in b4 True >>> b'common' in b4 True >>> b1 |= b2 # or using in-place operations (works with += too) >>> b'a' in b1 True >>> b'b' in b1 True >>> b'common' in b1 True `
Metadata
Release files for ethereum-bloom 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ethereum-bloom-0.3.0.tar.gz | 3.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ethereum_bloom-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.3 kB
Release files / ethereum-bloom-0.3.0.tar.gz
| Download URL | ethereum-bloom-0.3.0.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5f4172839b3d3f009528efe60331d1c24de6ca4da308bad876d1830a2cb4b7d7
|
|
BLAKE2b-256 checksum How to use checksums |
482154a3c7dc5c9228138e1b78816013bf888e5b60614b0297627bd4bdcfea57
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / ethereum_bloom-0.3.0-py3-none-any.whl
| Download URL | ethereum_bloom-0.3.0-py3-none-any.whl |
|---|---|
| Size | 4.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4702b15d0aee2474552bdb7962152f4ec2cb336a6b8f414410a63e59ac7e1573
|
|
BLAKE2b-256 checksum How to use checksums |
51d1204ed285adc701b7088b08e6de251348a0548270ed1fef2236e493772c3c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |