sBloomFilter - A C extension library of Bloom Filter for Ruby

  • This is the C extension library of Bloom Filter.
  • What is the Bloom Filter? Check here.

Synopisis

	    #!/usr/bin/env ruby
	    require 'sbloomfilter'
	    def main
    
	    # m=100000000, k=4, random seed=1
	    bf = BloomFilter.new(100000000, 4, 1)
	    num = 0
	      while line = ARGF.gets
  	        data = line.chop
	        if bf.new_entry?(data)
	          num += 1
	          bf.insert(data)
	        end
	      end 
	    print "#distinct element = #{num}\n"
	    end

	    main
	  

Install

	    % ruby extconf.rb
	    % make
	    % make install
	  

Download

Valdzone