Parse UINT64 as hex.

This commit is contained in:
Arthur Britto
2012-10-05 18:25:33 -07:00
parent b1e147200c
commit 95d1127dad
3 changed files with 14 additions and 1 deletions

View File

@@ -2,6 +2,7 @@
#include "uint256.h"
#include <boost/asio.hpp>
#include <boost/foreach.hpp>
#include <boost/regex.hpp>
//
@@ -67,6 +68,16 @@ std::vector<unsigned char> strUnHex(const std::string& strSrc)
return strCopy(strTmp);
}
uint64_t uintFromHex(const std::string& strSrc)
{
uint64_t uValue = 0;
BOOST_FOREACH(char c, strSrc)
uValue = (uValue << 4) | charUnHex(c);
return uValue;
}
//
// Misc string
//