MCPcopy Create free account
hub / github.com/brichard19/BitCrack / getOptimalBloomFilterMask

Method getOptimalBloomFilterMask

CLKeySearchDevice/CLKeySearchDevice.cpp:89–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87}
88
89uint64_t CLKeySearchDevice::getOptimalBloomFilterMask(double p, size_t n)
90{
91 double m = 3.6 * ceil((n * std::log(p)) / std::log(1 / std::pow(2, std::log(2))));
92
93 unsigned int bits = (unsigned int)std::ceil(std::log(m) / std::log(2));
94
95 return ((uint64_t)1 << bits) - 1;
96}
97
98void CLKeySearchDevice::initializeBloomFilter(const std::vector<struct hash160> &targets, uint64_t mask)
99{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected