| 87 | } |
| 88 | |
| 89 | uint64_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 | |
| 98 | void CLKeySearchDevice::initializeBloomFilter(const std::vector<struct hash160> &targets, uint64_t mask) |
| 99 | { |
nothing calls this directly
no outgoing calls
no test coverage detected