title: Perfect hash for string with known number of keys
body: <p>Is it possible to have a perfect hash function from strings to integers, when the number of elements to be hashed is known? By perfect hash function I mean that there is no chance of collision.</p>
  
  <p>Basically I am reading the signatures of multiple tables from a file (e.g. id, name, address). Different tables might have common attributes (e.g. name), but on <em>different</em> positions (i.e. columns). I would like to be able to ask something like: what is table1["name"]? or table2["name"].</p>
  
  <p>UPDATE: I would prefer learning to do it myself than using something already out there.</p>