title: How to convert char to hex stored in uint8_t form?
body: <p>Suppose I have these variables,</p>
  
  <pre><code>const uint8_t ndef_default_msg[33] = {
      0xd1, 0x02, 0x1c, 0x53, 0x70, 0x91, 0x01, 0x09,
      0x54, 0x02, 0x65, 0x6e, 0x4c, 0x69, 0x62, 0x6e,
      0x66, 0x63, 0x51, 0x01, 0x0b, 0x55, 0x03, 0x6c,
      0x69, 0x62, 0x6e, 0x66, 0x63, 0x2e, 0x6f, 0x72,
      0x67
  };
  uint8_t *ndef_msg;
  char *ndef_input = NULL;
  </code></pre>
  
  <p>How can I convert <code>ndef_input</code> (which is just a plain text, like "hello") to hex and save into <code>ndef_msg</code>?
  As you can see <code>ndef_default_msg</code> is in hex form. Data inside <code>ndef_msg</code> should be something like that as well.</p>
  
  <p>A bit of background, in the original program (<a href="http://pastebin.com/VY5ynNDw" rel="nofollow">source code</a>), the program will open a file, get the data and put it inside <code>ndef_msg</code>, which then will be written into a card. But I don't understand how it can take the data and convert to hex.</p>
  
  <p>I want to simplify the program so it will directly ask user for text (instead of asking for a file).</p>