Algorithm::BloomFilter - A bloom filter implementation in Perl 6
use Algorithm::BloomFilter;
my $filter = Algorithm::BloomFilter.new(
capacity => 100,
error-rate => 0.01,
);
$filter.add("foo-bar");
$filter.check("foo-bar"); # True
$filter.check("bar-foo"); # False with possible false-positive
Algorithm::BloomFilter is a pure Perl 6 implementation of Bloom Filter, mostly based on Bloom::Filter from Perl 5.
Digest::MurmurHash3 is used for hashing from version 0.1.0.
Creates a Bloom::Filter instance.
Adds a given key to filter instance.
Checks if a given key is in filter instance.
Calculates and returns filter's length and a number of hash functions.
Creates and returns $count
unique and random uint32 salts.
Calculates and returns positions to check in a bit vector.
yowcow yowcow@cpan.org
Copyright 2016 yowcow
This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.