class BloomFilter extends BytesSerializable
This implementation of Bloom filter is inspired from the Ethereum Yellow Paper for more information, visit: http://gavwood.com/paper.pdf (as of 2020.11.20 there is an error in footnote 3 - 211 = 2048) Another explanation can be found here (but he messes denoting the byte pairs, this stuff is tricky) https://ethereum.stackexchange.com/questions/59203/what-exactly-does-the-m-function-in-the-formal-bloom-filter-specifications-do A calculator to look at the false positivity rate can be found here https://hur.st/bloomfilter/?n=100&p=&m=2048&k=4 The bloom filter is constructed by taking the low-order 11 bits (mod 2048) of each of the first four pairs of bytes from a Blake2b-256 hash In english, the algorithm is to hash the input topic, take the first 8 bytes from the hash output, pair them up (1,2) (3,4) (5,6) (7,8), then take the first 11 bits from each pair (each pair is 16 bits and we take 11 bits because 211 = 2048). These bits can be retrieved using a bit-wise AND operation. For each of the 11-bit numbers we construct a positive definite integer between (0 & 2047). This integer is the index of the bit to flip in the bloom filter. Finally, the bloom filter is represented as a Array[Long] so we must apply two additional bit-wise AND operations on each index to find which Long should be changed in the bloom filter and finally which bit of the Long must be flipped.
- Alphabetic
- By Inheritance
- BloomFilter
- BytesSerializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
- type M = BloomFilter
- Definition Classes
- BloomFilter → BytesSerializable
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- lazy val bytes: Array[Byte]
- Definition Classes
- BytesSerializable
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def contains(topic: BloomTopic): Boolean
Check if a given topic is included in the Bloom filter
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(obj: Any): Boolean
- Definition Classes
- BloomFilter → AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- BloomFilter → AnyRef → Any
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- lazy val serializer: BifrostSerializer[BloomFilter]
- Definition Classes
- BloomFilter → BytesSerializable
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
JAA - DO NOT USE THE
.bytesortoBytesmethods from the BifrostSerailizer, this must be fixed lengthJAA - DO NOT USE THE
.bytesortoBytesmethods from the BifrostSerailizer, this must be fixed length- Definition Classes
- BloomFilter → AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()