MCPcopy Create free account
hub / github.com/citp/BlockSci / add

Method add

tools/parser/bloom_filter.cpp:104–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104void BloomFilter::add(const uint8_t *item, int length) {
105 auto hashValues = hash(item, length);
106
107 for (uint8_t n = 0; n < impData.m_numHashes; n++) {
108 auto bitPos = nthHash(n, hashValues[0], hashValues[1], impData.length);
109 store.setBit(bitPos);
110 }
111
112 impData.addedCount++;
113}
114
115bool BloomFilter::possiblyContains(const uint8_t *item, int length) const {
116 auto hashValues = hash(item, length);

Callers 12

stepsMethod · 0.45
getDataMethod · 0.45
addOutputMethod · 0.45
RANGES_FORMethod · 0.45
resolveAddressMethod · 0.45
insertMethod · 0.45
serializeInputImpMethod · 0.45
test_map_txesFunction · 0.45
test_select_txesFunction · 0.45
test_map_outputsFunction · 0.45
test_select_outputsFunction · 0.45
test_where_tx_locktimeFunction · 0.45

Calls 3

hashFunction · 0.85
nthHashFunction · 0.85
setBitMethod · 0.80

Tested by 5

test_map_txesFunction · 0.36
test_select_txesFunction · 0.36
test_map_outputsFunction · 0.36
test_select_outputsFunction · 0.36
test_where_tx_locktimeFunction · 0.36