MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / bloom_insert

Function bloom_insert

nodedb-columnar/src/predicate.rs:398–403  ·  view source on GitHub ↗

Insert a string value into a `BloomFilter`.

(bloom: &mut BloomFilter, value: &str)

Source from the content-addressed store, hash-verified

396
397/// Insert a string value into a `BloomFilter`.
398pub fn bloom_insert(bloom: &mut BloomFilter, value: &str) {
399 for i in 0..(bloom.k as u32) {
400 let bit = bloom_bit_pos(value, i, bloom.m);
401 bloom.bytes[bit / 8] |= 1 << (bit % 8);
402 }
403}
404
405/// Test whether a string value may be present in a `BloomFilter`.
406///

Callers 2

build_bloom_with_paramsFunction · 0.85

Calls 1

bloom_bit_posFunction · 0.85

Tested by

no test coverage detected