bloom: add string version
[fio.git] / lib / bloom.c
index 3369c5e99ed72bb112fcb95b440fcc27919f93c4..c2e6c11f2e1444020ae18225f8277938827c37f9 100644 (file)
@@ -88,7 +88,7 @@ void bloom_free(struct bloom *b)
        free(b);
 }
 
        free(b);
 }
 
-static bool __bloom_check(struct bloom *b, void *data, unsigned int len,
+static bool __bloom_check(struct bloom *b, const void *data, unsigned int len,
                          bool set)
 {
        uint32_t hash[N_HASHES];
                          bool set)
 {
        uint32_t hash[N_HASHES];
@@ -117,3 +117,8 @@ bool bloom_set(struct bloom *b, uint32_t *data, unsigned int nwords)
 {
        return __bloom_check(b, data, nwords * sizeof(uint32_t), true);
 }
 {
        return __bloom_check(b, data, nwords * sizeof(uint32_t), true);
 }
+
+bool bloom_set_string(struct bloom *b, const char *data, unsigned int len)
+{
+       return __bloom_check(b, data, len, true);
+}