class BloomFilter::Filter
- BloomFilter::Filter
- Reference
- Object
Defined in:
bloom_filter/filter.crConstant Summary
-
MULT_A =
3098757933_u32
-
MULT_B =
1388749529_u32
-
SEED_A =
3735928559_u32
-
SEED_B =
1912536813_u32
Constructors
- .new(bytesize : UInt32, hash_num, bitmap : Array(UInt8) = Array(UInt8).new(bytesize.to_i32, 0_u8))
-
.new(io : IO)
I used to load filter from file (see BloomFilter.load).
Instance Method Summary
-
#&(another : Filter) : Filter
Get intersection of two filters.
- #==(another : Filter)
-
#|(another : Filter) : Filter
Get a union of two filters.
- #bitmap : Array(UInt8)
- #bitsize : UInt32
- #bytesize : UInt32
- #dump(io : IO)
-
#dump_file(file_path)
Saves bloom filter into binary file.
-
#has?(str : String) : Bool
Verifies, whether the filter contains given item.
- #hash_num : UInt8
- #insert(str : String)
-
#visualize
Convert bitmap into string representation of bitmap with highlighted bits.
Constructor Detail
def self.new(bytesize : UInt32, hash_num, bitmap : Array(UInt8) = Array(UInt8).new(bytesize.to_i32, 0_u8))
#
Instance Method Detail
def visualize
#
Convert bitmap into string representation of bitmap with highlighted bits. Should be used only for debugging and fun:)