title: Convert MD5 representation to hex in C++
body: <p>I have an MD5 string which i am converting to hex. Is there a better way to do this? I currently am doing:</p>
  
  <pre><code>unsigned char digest[16]; 
  string result;
  char buf[32];
  for (int i=0; i&lt;16; i++)
  {
     sprintf_s(buf, "%02x", digest[i]);
     result.append( buf );
  }
  </code></pre>