mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Replace std::vector<unsigned char> with Blob
This commit is contained in:
@@ -51,7 +51,7 @@ inline uint256 SHA256Hash(const T1 p1begin, const T1 p1end,
|
||||
return hash2;
|
||||
}
|
||||
|
||||
inline uint160 Hash160(const std::vector<unsigned char>& vch)
|
||||
inline uint160 Hash160(Blob const& vch)
|
||||
{
|
||||
uint256 hash1;
|
||||
SHA256(&vch[0], vch.size(), (unsigned char*)&hash1);
|
||||
|
||||
@@ -90,7 +90,7 @@ int strUnHex(std::string& strDst, const std::string& strSrc)
|
||||
return iBytes;
|
||||
}
|
||||
|
||||
std::vector<unsigned char> strUnHex(const std::string& strSrc)
|
||||
Blob strUnHex(const std::string& strSrc)
|
||||
{
|
||||
std::string strTmp;
|
||||
|
||||
@@ -113,9 +113,9 @@ uint64_t uintFromHex(const std::string& strSrc)
|
||||
// Misc string
|
||||
//
|
||||
|
||||
std::vector<unsigned char> strCopy(const std::string& strSrc)
|
||||
Blob strCopy(const std::string& strSrc)
|
||||
{
|
||||
std::vector<unsigned char> vucDst;
|
||||
Blob vucDst;
|
||||
|
||||
vucDst.resize(strSrc.size());
|
||||
|
||||
@@ -124,7 +124,7 @@ std::vector<unsigned char> strCopy(const std::string& strSrc)
|
||||
return vucDst;
|
||||
}
|
||||
|
||||
std::string strCopy(const std::vector<unsigned char>& vucSrc)
|
||||
std::string strCopy(Blob const& vucSrc)
|
||||
{
|
||||
std::string strDst;
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ inline const std::string strHex(const std::string& strSrc)
|
||||
return strHex(strSrc.begin(), strSrc.size());
|
||||
}
|
||||
|
||||
inline std::string strHex(const std::vector<unsigned char>& vucData)
|
||||
inline std::string strHex(Blob const& vucData)
|
||||
{
|
||||
return strHex(vucData.begin(), vucData.size());
|
||||
}
|
||||
@@ -117,7 +117,7 @@ inline static std::string sqlEscape(const std::string& strSrc)
|
||||
return str(boost::format(f) % strHex(strSrc));
|
||||
}
|
||||
|
||||
inline static std::string sqlEscape(const std::vector<unsigned char>& vecSrc)
|
||||
inline static std::string sqlEscape(Blob const& vecSrc)
|
||||
{
|
||||
size_t size = vecSrc.size();
|
||||
if (size == 0)
|
||||
@@ -156,10 +156,10 @@ int strUnHex(std::string& strDst, const std::string& strSrc);
|
||||
|
||||
uint64_t uintFromHex(const std::string& strSrc);
|
||||
|
||||
std::vector<unsigned char> strUnHex(const std::string& strSrc);
|
||||
Blob strUnHex(const std::string& strSrc);
|
||||
|
||||
std::vector<unsigned char> strCopy(const std::string& strSrc);
|
||||
std::string strCopy(const std::vector<unsigned char>& vucSrc);
|
||||
Blob strCopy(const std::string& strSrc);
|
||||
std::string strCopy(Blob const& vucSrc);
|
||||
|
||||
bool parseIpPort(const std::string& strSource, std::string& strIP, int& iPort);
|
||||
bool parseQuality(const std::string& strSource, uint32& uQuality);
|
||||
|
||||
Reference in New Issue
Block a user