Subject: [ruby-talk:8316] Re: speedup of anagram finder
From: "Christoph Rippel" <crippel primenet.com>
Date: Sat, 30 Dec 2000 08:40:02 +0900
References: 8287
> key = 1
> word.each_byte {|s| key *= asc2prime[s]}
Hm,
isn't something like
key = 0
word.each_byte do |s|
key << 5 # multiply by 32
if s < 97
key+= s - 64
else
key+= s - 96
end
end
much simpler (and faster)?
Christoph