book supplied java code hashing with strings