Proper hashing for comparable object types.