astropanic
11/3/2014 - 10:14 AM

Ruby is a beautiful language

Ruby is a beautiful language

return (1<<31) - (name.downcase.each_byte.each_with_index.to_a.inject(0.0) {|s,(v,i)| s+=(v.to_f/[((2**8)*i), 1.0].max);s} * (2**23)).to_i