Packages

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.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. BloomFilter
  2. BytesSerializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. type M = BloomFilter
    Definition Classes
    BloomFilter → BytesSerializable

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. lazy val bytes: Array[Byte]
    Definition Classes
    BytesSerializable
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  7. def contains(topic: BloomTopic): Boolean

    Check if a given topic is included in the Bloom filter

  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(obj: Any): Boolean
    Definition Classes
    BloomFilter → AnyRef → Any
  10. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  11. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. def hashCode(): Int
    Definition Classes
    BloomFilter → AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. lazy val serializer: BifrostSerializer[BloomFilter]
    Definition Classes
    BloomFilter → BytesSerializable
  18. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  19. def toString(): String

    JAA - DO NOT USE THE .bytes or toBytes methods from the BifrostSerailizer, this must be fixed length

    JAA - DO NOT USE THE .bytes or toBytes methods from the BifrostSerailizer, this must be fixed length

    Definition Classes
    BloomFilter → AnyRef → Any
  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  21. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  22. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from BytesSerializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped