Turnstone Operating System
Loading...
Searching...
No Matches
bloomfilter.64.c File Reference

bloom filter implementation More...

#include <bloomfilter.h>
#include <math.h>
#include <xxhash.h>
#include <memory.h>
#include <random.h>

Classes

struct  bloomfilter_t
 bloom filter struct More...
 

Typedefs

typedef struct bloomfilter_t bloomfilter_t
 

Functions

 MODULE ("turnstone.lib")
 
boolean_t bloomfilter_check_or_add (bloomfilter_t *bf, data_t *data, boolean_t add)
 checks or adds given value to the given bloom filter More...
 
bloomfilter_tbloomfilter_new (uint64_t entry_count, float64_t error)
 creates new bloomfilter More...
 
boolean_t bloomfilter_destroy (bloomfilter_t *bf)
 destroy's bloom filter More...
 
boolean_t bloomfilter_check (bloomfilter_t *bf, data_t *data)
 check given data in bloom filter More...
 
boolean_t bloomfilter_add (bloomfilter_t *bf, data_t *data)
 add given data to bloom filter More...
 
data_tbloomfilter_serialize (bloomfilter_t *bf)
 serialize given bloom filter More...
 
bloomfilter_tbloomfilter_deserialize (data_t *data)
 deserialize given bloom filter More...
 

Detailed Description

bloom filter implementation

This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.

Function Documentation

◆ bloomfilter_add()

boolean_t bloomfilter_add ( bloomfilter_t bf,
data_t data 
)

add given data to bloom filter

Parameters
[in]bfbloom filter
[in]datagiven data
Returns
true if added

◆ bloomfilter_check()

boolean_t bloomfilter_check ( bloomfilter_t bf,
data_t data 
)

check given data in bloom filter

Parameters
[in]bfbloom filter
[in]datagiven data
Returns
true if found

◆ bloomfilter_check_or_add()

boolean_t bloomfilter_check_or_add ( bloomfilter_t bf,
data_t data,
boolean_t  add 
)

checks or adds given value to the given bloom filter

Parameters
[in]bfbloom filter
[in]datadata to add
[in]addif true then add or check only
Returns
check result

◆ bloomfilter_deserialize()

bloomfilter_t * bloomfilter_deserialize ( data_t data)

deserialize given bloom filter

Parameters
[in]datadata that holds serialized bloom filter
Returns
bloom filter

◆ bloomfilter_destroy()

boolean_t bloomfilter_destroy ( bloomfilter_t bf)

destroy's bloom filter

Parameters
[in]bfbloom filter
Returns
true if succeed.

◆ bloomfilter_new()

bloomfilter_t * bloomfilter_new ( uint64_t  entry_count,
float64_t  error 
)

creates new bloomfilter

Parameters
[in]entry_counthow many entries
[in]errorerror rate for false positive
Returns
bloom filter

◆ bloomfilter_serialize()

data_t * bloomfilter_serialize ( bloomfilter_t bf)

serialize given bloom filter

Parameters
[in]bfbloom filter to serialize
Returns
serialized data