Changeset View
Changeset View
Standalone View
Standalone View
src/bloom.h
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | private: | ||||
bool isEmpty; | bool isEmpty; | ||||
uint32_t nHashFuncs; | uint32_t nHashFuncs; | ||||
uint32_t nTweak; | uint32_t nTweak; | ||||
uint8_t nFlags; | uint8_t nFlags; | ||||
uint32_t Hash(uint32_t nHashNum, | uint32_t Hash(uint32_t nHashNum, | ||||
const std::vector<uint8_t> &vDataToHash) const; | const std::vector<uint8_t> &vDataToHash) const; | ||||
// Private constructor for CRollingBloomFilter, no restrictions on size | |||||
CBloomFilter(const uint32_t nElements, const double nFPRate, | |||||
const uint32_t nTweak); | |||||
friend class CRollingBloomFilter; | |||||
public: | public: | ||||
/** | /** | ||||
* Creates a new bloom filter which will provide the given fp rate when | * Creates a new bloom filter which will provide the given fp rate when | ||||
* filled with the given number of elements. Note that if the given | * filled with the given number of elements. Note that if the given | ||||
* parameters will result in a filter outside the bounds of the protocol | * parameters will result in a filter outside the bounds of the protocol | ||||
* limits, the filter created will be as close to the given parameters as | * limits, the filter created will be as close to the given parameters as | ||||
* possible within the protocol limits. This will apply if nFPRate is very | * possible within the protocol limits. This will apply if nFPRate is very | ||||
* low or nElements is unreasonably high. nTweak is a constant which is | * low or nElements is unreasonably high. nTweak is a constant which is | ||||
▲ Show 20 Lines • Show All 93 Lines • Show Last 20 Lines |