module

CuckooFilter

Constants

BUCKET_SIZE = 4
DEFAULT_CAPACITY = 10000_u64
DEFAULT_LOAD_FACTOR = 0.9_f32
DEFAULT_SCALE_FACTOR = ->(current_bucket_count : UInt64) do (current_bucket_count * BUCKET_SIZE) * 2 end
FNV_OFFSET = 14695981039346656037_u64
FNV_PRIME = 1099511628211_u64
MAX_CUCKOO_COUNT = 500
NULL_FP = 0_u8
NULL_FP16 = 0_u16
VERSION = "0.1.0"

Class methods

alt_hash(fingerprint : UInt8) : UInt64
Source
alt_hash(fingerprint : UInt16) : UInt64
Source
alt_index(fingerprint : UInt8, index : UInt64, bucket_pow : UInt32) : UInt64
Source
alt_index(fingerprint : UInt16, index : UInt64, bucket_pow : UInt32) : UInt64
Source
decode(bytes : Bytes) : Filter
Source
decode16(bytes : Bytes) : Filter16
Source
decode_scalable_filter(bytes : Bytes) : ScalableFilter
Source
decode_scalable_filter16(bytes : Bytes) : ScalableFilter16
Source
default_hasher
Source
default_hasher=(hasher : Hasher)
Source
fingerprint(hash : UInt64) : UInt8
Source
fingerprint16(hash : UInt64) : UInt16
Source
fnv1a64(data : Bytes) : UInt64
Source
index_and_fingerprint(data : Bytes, bucket_pow : UInt32) : Tuple(UInt64, UInt8)
Source
index_and_fingerprint16(data : Bytes, bucket_pow : UInt32) : Tuple(UInt64, UInt16)
Source
mask_for(bits : UInt32) : UInt64
Source
new_filter(capacity : Int) : Filter
Source
new_filter16(capacity : Int) : Filter16
Source
new_scalable_filter(load_factor : Float32 = DEFAULT_LOAD_FACTOR, capacity : Int = DEFAULT_CAPACITY.to_i, scale_factor : Proc(UInt64, UInt64) = DEFAULT_SCALE_FACTOR) : ScalableFilter
Source
new_scalable_filter16(load_factor : Float32 = DEFAULT_LOAD_FACTOR, capacity : Int = DEFAULT_CAPACITY.to_i, scale_factor : Proc(UInt64, UInt64) = DEFAULT_SCALE_FACTOR) : ScalableFilter16
Source
next_power_of_two(value : UInt64) : UInt64
Source

Nested types