title: C++ converting hexadecimal md5 hash to decimal integer
body: <p>I'm doing Elgamal Signature Scheme and I need to use the decimal hash value from the message to compute S for signature generation. An example of the hexadecimal hash is:</p>
  
  <pre><code>820dbb4256a4287557ade2f729d279f1
  </code></pre>
  
  <p>As you can see above, the hash value is a 32-digits hexadecimal number. I need to transform the string above to decimal integer and use it for calculation later.</p>
  
  <pre><code>    string hash = md5(message);
      cout &lt;&lt; hash &lt;&lt; endl;
      NTL::ZZ msgHash = strtol(hash.c_str(), NULL, 16);
      cout &lt;&lt; msgHash &lt;&lt; endl;
  </code></pre>
  
  <p>There are no integer large enough to contain the value of 32 byte hexadecimal hash, and so I tried big integer from NTL library but it didn't work out because you cannot assign the long integer returned from strtol function (And I think the decimal hash value is way longer than long integer range limit) to NTL::ZZ type. Is there any good solution to this? </p>
  
  <p>I'm doing this with visual C++ in Visual Studio 2013.</p>