title: What is the best way to decode a message given a hash function
body: <p>I have a .txt file that has an encoded message, to decodde it you have to switch specific characters to a character in the alphabet. (It's like a letter x pointing to the letter y) then use it to decode the message from the .txt file.
  I have the alphabet stored in a c-string:</p>
  
  <pre><code>const int ALPHA_SIZE = 26;
  
  char alphabet[ALPHA_SIZE] = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
      'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
      'y', 'z' };
  </code></pre>
  
  <p>Then respectivelly the letters that correspond to the alphabet</p>
  
  <pre><code>char hashFunc[ALPHA_SIZE] = {'i', 'z', 't', 'o', 'h', 'n', 'd', 'b', 'e', 'q', 'r', 'k',
      'g', 'l', 'm', 'a', 'c', 's', 'v', 'w', 'f', 'u', 'y', 'p', 'x'};
  </code></pre>
  
  <p>Now, my text file has this:</p>
  
  <pre><code>ifqkwxcadf ar cei fpoi masif cd cei xkdqirr du pxxnwafm pf pnmdkaceo cd p oirrpmi, teaqe rqkpohnir cei gpcp af ac-oplafm ac sikw gauuaqvnc pfg caoi qdfrvoafm, au fdc xkpqcaqpnnw aoxdrrahni, cd gigvqi cei dkamafpn masif dfnw cei ifqdgig gpcp. afxvcr cd cei pnmdkaceo cwxaqpnnw afsdnsi pggacadfpn riqkic gpcp qpnnig liwr, teaqe xkisifcr cei oirrpmi ukdo hiafm giqdgig-isif au cei pnmdkaceo ar xvhnaqnw lfdtf.
  </code></pre>
  
  <p>How do I correlate these 3 to give me the decoded message? I was thinking through switch statement but I'm sure there's other way more efficient than this. Thank you.</p>