I can use this hash function for strings but the problem with it is that anagrams will have the same hash value. I want to modify this so that they don't have the same hash values.
def hash(a_string, table_size):
sum = 0
for pos in range(len(a_string)):
sum = sum + ord(a_string[pos])
return sum % table_size