OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_RAPPOR_BLOOM_FILTER_H_ |
| 6 #define CHROME_BROWSER_RAPPOR_BLOOM_FILTER_H_ |
| 7 |
| 8 #include <stdint.h> |
| 9 |
| 10 #include <string> |
| 11 #include <vector> |
| 12 |
| 13 #include "components/rappor/bytevector.h" |
| 14 |
| 15 namespace rappor { |
| 16 |
| 17 // BloomFilter is a simple bloom filter for keeping track of a set of strings. |
| 18 class BloomFilter { |
| 19 public: |
| 20 BloomFilter(uint32_t bytes_size, uint32_t hash_count); |
| 21 void Add(const std::string& str); |
| 22 void Add(const std::vector<std::string>& strings); |
| 23 const ByteVector& bytes() const; |
| 24 uint32_t hash_count() const; |
| 25 |
| 26 private: |
| 27 ByteVector bytes_; |
| 28 uint32_t hash_count_; |
| 29 }; |
| 30 |
| 31 } // namespace rappor |
| 32 |
| 33 #endif // CHROME_BROWSER_RAPPOR_BLOOM_FILTER_H_ |
OLD | NEW |