Why count the hash value in this way?