OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_RAPPOR_BLOOM_FILTER_H_ | 5 #ifndef COMPONENTS_RAPPOR_BLOOM_FILTER_H_ |
6 #define COMPONENTS_RAPPOR_BLOOM_FILTER_H_ | 6 #define COMPONENTS_RAPPOR_BLOOM_FILTER_H_ |
7 | 7 |
| 8 #include <stdint.h> |
| 9 |
8 #include <string> | 10 #include <string> |
9 | 11 |
10 #include "base/basictypes.h" | |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "components/rappor/byte_vector_utils.h" | 13 #include "components/rappor/byte_vector_utils.h" |
13 | 14 |
14 namespace rappor { | 15 namespace rappor { |
15 | 16 |
16 // BloomFilter is a simple Bloom filter for keeping track of a set of strings. | 17 // BloomFilter is a simple Bloom filter for keeping track of a set of strings. |
17 class BloomFilter { | 18 class BloomFilter { |
18 public: | 19 public: |
19 // Constructs a BloomFilter using |bytes_size| bytes of Bloom filter bits, | 20 // Constructs a BloomFilter using |bytes_size| bytes of Bloom filter bits, |
20 // and |hash_function_count| hash functions to set bits in the filter. The | 21 // and |hash_function_count| hash functions to set bits in the filter. The |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 uint64_t GetBloomBits(uint32_t bytes_size, | 55 uint64_t GetBloomBits(uint32_t bytes_size, |
55 uint32_t hash_function_count, | 56 uint32_t hash_function_count, |
56 uint32_t hash_seed_offset, | 57 uint32_t hash_seed_offset, |
57 const std::string& str); | 58 const std::string& str); |
58 | 59 |
59 } // namespace internal | 60 } // namespace internal |
60 | 61 |
61 } // namespace rappor | 62 } // namespace rappor |
62 | 63 |
63 #endif // COMPONENTS_RAPPOR_BLOOM_FILTER_H_ | 64 #endif // COMPONENTS_RAPPOR_BLOOM_FILTER_H_ |
OLD | NEW |