I am studying Compilers recently, and I want to implement a lexer.   When I was designing the Symbol Table of lexer, I was thinking of to make the hash value of the identifier to the Symbol Table index.  However, I was confused about which hash function I should use, can anyone give me some advice?  I want to implement the lexer with C++, and say the identifier is made of letter, number and underscore, and it only starts with letter or underscore.  Thank you in advance!
What is a good Hash function? I saw a lot of hash function and applications in my data structures courses in college, but I mostly got that it's pretty hard to make a good hash function. As a rule of thumb to avoid collisions my professor said that:  function Hash(key)   return key mod PrimeNumber end   (mod is the % operator in C and similar languages)  with the prime number to be the size of the hash table. I get that is a somewhat good function to avoid collisions and a fast one, but how can I make a better one? Is there better hash functions for string keys against numeric keys?
The entire  site is blank right now.  The header and footer are shown, but no questions.