@@ -25,7 +25,9 @@ class BloomFilter {
25
25
HashFn hashFns[] = defaultHashFns,
26
26
int numHashFns = sizeof (defaultHashFns)/sizeof (defaultHashFns[0 ]));
27
27
~BloomFilter ();
28
+ // Sets the specified bit in the buffer
28
29
void setBit (unsigned int bitLocation);
30
+ // Checks if the specified bit is set in the buffer
29
31
bool isBitSet (unsigned int bitLocation);
30
32
// Adds the specified buffer to the bloom filter
31
33
void add (const char *input, int len);
@@ -34,7 +36,7 @@ class BloomFilter {
34
36
/* *
35
37
* Checks whether an element probably exists in the set, or definitely
36
38
* doesn't.
37
- * @param str Either a string to check for existance or an array of the
39
+ * @param sz Either a string to check for existance or an array of the
38
40
* string's char codes. The main reason why you'd want to pass in a char
39
41
* code array is because passing a string will use JS directly to get
40
42
* the char codes which is very inneficient compared to calling into C++
@@ -56,10 +58,16 @@ class BloomFilter {
56
58
bool substringExists (const char *data, int dataLen, int substringLength);
57
59
bool substringExists (const char *sz, int substringLength);
58
60
61
+ /* *
62
+ * Obtains the buffer used as the bloom filter data
63
+ */
59
64
const char * getBuffer () {
60
65
return buffer;
61
66
}
62
67
68
+ /* *
69
+ * Obtains the Bloom Filter's buffer size in bytes
70
+ */
63
71
int getByteBufferSize () {
64
72
return byteBufferSize;
65
73
}
0 commit comments