| Path: | ReadMe |
| Last Update: | Sat Mar 04 18:10:47 CST 2006 |
BloomFilter — A class for making bloomfilters
#!/usr/bin/ruby -w
require 'bloomfilter'
bf = BloomFilter.new(1000, 0.01) # 1000 keys, 1% false-positives
bf.add("foo")
puts "Yup" if bf.has?("foo")
BloomFilter will try to load BitSet and if that fails it will fall back to an included, but limited/slower SimpleVector library — this included slow library is not suitable for anything more than just playing around.
$ ruby setup.rb config $ ruby setup.rb setup $ ruby setup.rb install
This will set up and install the necessary files in the default Ruby locations. For additional installation help and options, type:
$ ruby setup.rb --help
Run the tests (before installing if desired) with:
$ ruby test/testsuite.rb
Andrew L Johnson <andrew@siaris.net>
copyright 2006, Andrew L Johnson
Licensed with the same terms as Ruby itself