title: Given a hexadecimal string in Swift, convert to hex value
body: <p>Suppose I am given a string like this:</p>
  
  <blockquote>
    <p>D7C17A4F</p>
  </blockquote>
  
  <p>How do I convert each individual character to a hex value?</p>
  
  <p>So <code>D</code> should be <code>0xD</code>, <code>7</code> should be <code>0x7</code>…</p>
  
  <p>Right now, I have each individual character represented as it's ASCII value. <code>D</code> is <code>68</code>, <code>7</code> is <code>55</code>. I'm trying to pack those two values into one byte. For example: <code>D7</code> becomes <code>0xD7</code> and <code>C1</code> becomes <code>0xC1</code>. I can't do that using the ASCII decimal values though.</p>