I know this may not just be for hash tables but an answer with respect to it will help me better understand it:
int hash (const string & key, int tableSize) {
int hashVal = 0;
for (char ch : key) // ????lost here??? is ch is just any character in the key???
hashVal += ch;
return hashVal % tableSize;
}