title: How to convert an ASCII HEX character to it's value (0-15)?
body: <p>I am writing a string parser and the thought occurred to me that there might be some really interesting ways to convert an ASCII hexadecimal character <code>[0-9A-Fa-f]</code> to it's numeric value.</p>
  
  <p>What are the quickest, shortest, most elegant or most obscure ways to convert <code>[0-9A-Fa-f]</code> to it's value between <code>0</code> and <code>15</code>?</p>
  
  <p>Assume, if you like, that the character is a valid hex character.</p>
  
  <p>I have no chance so I'll have a go at the most boring.</p>
  
  <pre><code>( c &lt;= '9' ) ? ( c - '0' ) : ( (c | '\x60') - 'a' + 10 )
  </code></pre>