Refactored hashLetters to be less verbose.