mightContain method

bool mightContain(
  1. Uint8List key
)

Whether key may be present. False positives are possible; false negatives are not.

Implementation

bool mightContain(Uint8List key) {
  final h1 = VxsCrc32c.compute(key);
  final h2 = ((h1 >>> 16) ^ (h1 & 0xFFFF)) | 1;
  for (var i = 0; i < hashCount; i++) {
    final bit = (h1 + i * h2) % bitCount;
    if (bits[bit >> 3] & (1 << (bit & 7)) == 0) return false;
  }
  return true;
}