Minhash algorithm implementation in Ruby