Пример #1
0
TEST(testbloom, test_7)
{
	HashBloom bloom;
	ByteVector v;
	bloom.reset(2, 1024, 64);
	bloom.add(TTHValue("QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"));
	bloom.copy_to(v);
	ASSERT_EQ("AEAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
		HashValue<Hasher>(&v[0]).toBase32());
}
Пример #2
0
TEST(testbloom, test_4)
{
	HashBloom bloom;
	ByteVector v;
	bloom.reset(8, 1024, 24);
	bloom.add(TTHValue("UDRJ6EGCH3CGWIIU2V6CH7VLFN4N2PCZKSPTBQA"));
	bloom.copy_to(v);
	ASSERT_EQ("AAAAAAAABAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQACAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAA",
		HashValue<Hasher>(&v[0]).toBase32());
}
Пример #3
0
void ShareManager::getBloom(ByteVector& v, size_t k, size_t m, size_t h) const {
#ifdef __i386__
	dcdebug("Creating bloom filter, k=%u, m=%u, h=%u\n", k, m, h);
#else
	dcdebug("Creating bloom filter, k=%lu, m=%lu, h=%lu\n", k, m, h);
#endif	
	Lock l(cs);

	HashBloom bloom;
	bloom.reset(k, m, h);
	for(auto& i: tthIndex) {
		bloom.add(i.first);
	}
	bloom.copy_to(v);
}
Пример #4
0
void FileQueue::getBloom(HashBloom& bloom) const noexcept {
	for(auto& i: tthIndex) {
		if (i.second->getBundle()) {
			bloom.add(*i.first);
		}
	}
}