1
0
mirror of https://github.com/CovidBraceletPrj/CovidBracelet.git synced 2024-05-31 01:38:10 +02:00
CovidBracelet/src/bloom.h
2021-12-10 15:30:21 +01:00

30 lines
705 B
C

#ifndef BLOOM_H
#define BLOOM_H
#include "ens/storage.h"
typedef uint32_t (*hash_function)(const void* data);
typedef struct bloom_hash {
hash_function func;
struct bloom_hash* next;
} bloom_hash_t;
typedef struct bloom_filter {
bloom_hash_t* func;
uint8_t* data;
size_t size;
} bloom_filter_t;
/**
* Initialize the bloom filter on basis of the already registerred records.
*/
bloom_filter_t* bloom_create(size_t size);
// TODO lome: maybe only use RPI (should be sufficient)
void bloom_add_record(bloom_filter_t* bloom, record_t* record);
// TODO lome: maybe only use RPI (should be sufficient)
bool bloom_probably_has_record(bloom_filter_t* bloom, record_t* record);
#endif