polyswarmclient.ethereum.bloom
¶
Module Contents¶
-
class
polyswarmclient.ethereum.bloom.
BloomFilter
(value=0)[source]¶ Bases:
numbers.Number
-
add
(self, value)[source]¶ Add a single byte value to the Bloom filter.
- Parameters
value (bytes) – Byte encoded value to add to Bloom filter.
-
extend
(self, iterable)[source]¶ Add an iterable of byte values to the bloom filter.
- Parameters
iterable (Iterable[bytes]) – Iterable of byte values.
-
classmethod
from_iterable
(cls, iterable)[source]¶ Instantiate a bloom filter from a given iterable.
- Parameters
iterable (Iterable[bytes]) – Iterable of byte values.
- Returns
Instantiated BloomFilter.
- Return type
-
static
get_bloom_bits
(value)[source]¶ Bloom filter helper function. Get the Bloom bits of a given value.
- Parameters
value (bytes) – Value to be encoded into the Bloom filter.
-