title: Hex to Dec using bit-manipulation
body: <p>Could somebody explain how this actually works for example the <code>char input = 'a'</code>.
  I understand that &lt;&lt; shift the bits over by four places (for more than one character). But why in the second part add 9? I know 0xf = 15.....Am I missing something obvious.     </p>
  
  <pre><code>result = result &lt;&lt; 4 | *str + 9 &amp; 0xf;
  </code></pre>
  
  <p>Here is my understand so far:</p>
  
  <p>char input = 'a' ascii value is 97. Add 9 is 106, 106 in binary is 01101010. 0xf = 15 (00001111), therefore 01101010 &amp; 00001111 = 00001010, this gives the value of 10 and the result is then appended on to result.</p>
  
  <p>Thanks in advance.</p>