Class BloomFilter

A Bloom Filter is a client-side kept cache sketch of the server cache

Hierarchy

  • BloomFilter

Constructors

Properties

Methods

Constructors

  • Parameters

    • bloomFilter: {
          b: string;
          h: number;
          m: number;
      }

      The raw Bloom filter.

      • b: string

        The Base64-encoded raw Bloom filter bytes.

      • h: number

        The raw Bloom filter hashes.

      • m: number

        The raw Bloom filter bits.

    Returns BloomFilter

Properties

bits: number

The amount of bits.

bytes: string

The raw bytes of this Bloom filter.

creation: number

The creation timestamp of this bloom filter.

hashes: number

The amount of hashes.

Methods

  • Returns whether this Bloom filter contains the given element.

    Returns

    True, if the element is contained in this Bloom filter.

    Parameters

    • element: string

      The element to check if it is contained.

    Returns boolean

  • Checks whether a bit is set at a given position.

    Returns

    True, if the bit is set at the given position.

    Parameters

    • index: number

      The position index to check.

    Returns boolean

  • Returns the hases of a given element in the Bloom filter.

    Returns

    The hashes of an element in the Bloom filter.

    Parameters

    • element: string

      The element to check.

    • bits: number

      The amount of bits.

    • hashes: number

      The amount of hashes.

    Returns number[]

  • Calculate a Murmur3 hash.

    Returns

    A hashed value of key.

    Parameters

    • seed: number

      A seed to use for the hashing.

    • key: string

      A key to check.

    Returns number

Generated using TypeDoc