From: gotoken@... (GOTO Kentaro) Date: 2000-12-30T10:29:52+09:00 Subject: [ruby-talk:8321] Re: speedup of anagram finder In message "[ruby-talk:8316] Re: speedup of anagram finder" on 00/12/30, "Christoph Rippel" writes: >key = 0 >word.each_byte do |s| > key << 5 # multiply by 32 > if s < 97 > key+= s - 64 > else > key+= s - 96 > end >end I'm sorry to say that this kind of key is not unique for anagrams for each word. Use of prime numbers is essential here. -- Gotoken Btw, I read as "key <<= 5" ;-)