Adds the hash function.