Class: Google::Cloud::Firestore::V1::BloomFilter
- Inherits:
-
Object
- Object
- Google::Cloud::Firestore::V1::BloomFilter
- Extended by:
- Protobuf::MessageExts::ClassMethods
- Includes:
- Protobuf::MessageExts
- Defined in:
- proto_docs/google/firestore/v1/bloom_filter.rb
Overview
A bloom filter (https://en.wikipedia.org/wiki/Bloom_filter).
The bloom filter hashes the entries with MD5 and treats the resulting 128-bit hash as 2 distinct 64-bit hash values, interpreted as unsigned integers using 2's complement encoding.
These two hash values, named h1
and h2
, are then used to compute the
hash_count
hash values using the formula, starting at i=0
:
h(i) = h1 + (i * h2)
These resulting values are then taken modulo the number of bits in the bloom filter to get the bits of the bloom filter to test for the given entry.
Instance Attribute Summary collapse
-
#bits ⇒ ::Google::Cloud::Firestore::V1::BitSequence
The bloom filter data.
-
#hash_count ⇒ ::Integer
The number of hashes used by the algorithm.
Instance Attribute Details
#bits ⇒ ::Google::Cloud::Firestore::V1::BitSequence
Returns The bloom filter data.
72 73 74 75 |
# File 'proto_docs/google/firestore/v1/bloom_filter.rb', line 72 class BloomFilter include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end |
#hash_count ⇒ ::Integer
Returns The number of hashes used by the algorithm.
72 73 74 75 |
# File 'proto_docs/google/firestore/v1/bloom_filter.rb', line 72 class BloomFilter include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods end |