title: unsigned char* values to hexadecimal
body: <p>I have a typical use case where i need to convert the unsigned char values to hexadecimal.</p>
  
  <p>For example,</p>
  
  <pre><code>unsigned char *pBuffer = (unsigned char *)pvaluefromClient //where pvaluefromclient is received from a client
  </code></pre>
  
  <p>The length of pBuffer is 32 bytes and it holds the value as follows,</p>
  
  <pre><code>(gdb) p pBuffer 
  $5 = (unsigned char *) 0x7fd4b82cead0 "EBA5F7304554DCC3702E06182AB1D487"
  (gdb) n
  </code></pre>
  
  <p>STEP 1: I need to split this pBuffer value as follows,</p>
  
  <pre><code>{EB,A5,F7,30,45,54,DC,C3,70,2E,06,18,2A,B1,D4,87 }
  </code></pre>
  
  <p>STEP 2: I need to convert the above splited values to decimal as follows,</p>
  
  <pre><code>const unsigned char pConvertedBuffer[16] = {
      235,165,247,48,69,84,220,195,112,46,6,24,42,177,212,135
  };
  </code></pre>
  
  <p>Any idea on how to achieve the STEP1 and STEP2? any help on this would be highly appreciated</p>