mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Small optimizations.
This commit is contained in:
@@ -36,7 +36,7 @@ std::string EncodeBase64(const std::string& s)
|
||||
BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL);
|
||||
bmem = BIO_new(BIO_s_mem());
|
||||
b64 = BIO_push(b64, bmem);
|
||||
BIO_write(b64, s.c_str(), s.size());
|
||||
BIO_write(b64, s.data(), s.size());
|
||||
(void) BIO_flush(b64);
|
||||
BIO_get_mem_ptr(b64, &bptr);
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ uint128 CKey::PassPhraseToKey(const std::string& passPhrase)
|
||||
{
|
||||
Serializer s;
|
||||
|
||||
s.addRaw(passPhrase.c_str(), passPhrase.size());
|
||||
s.addRaw(passPhrase);
|
||||
uint256 hash256 = s.getSHA512Half();
|
||||
uint128 ret(hash256);
|
||||
|
||||
|
||||
@@ -411,7 +411,7 @@ Json::Value RPCHandler::doAccountEmailSet(const Json::Value ¶ms)
|
||||
boost::to_lower(strEmail);
|
||||
|
||||
std::vector<unsigned char> vucMD5(128/8, 0);
|
||||
MD5(reinterpret_cast<const unsigned char*>(strEmail.c_str()), strEmail.size(), &vucMD5.front());
|
||||
MD5(reinterpret_cast<const unsigned char*>(strEmail.data()), strEmail.size(), &vucMD5.front());
|
||||
|
||||
uint128 uEmailHash(vucMD5);
|
||||
std::vector<unsigned char> vucDomain;
|
||||
|
||||
@@ -189,7 +189,7 @@ std::string DecodeBase64(std::string s)
|
||||
|
||||
b64 = BIO_new(BIO_f_base64());
|
||||
BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL);
|
||||
bmem = BIO_new_mem_buf(const_cast<char*>(s.c_str()), s.size());
|
||||
bmem = BIO_new_mem_buf(const_cast<char*>(s.data()), s.size());
|
||||
bmem = BIO_push(b64, bmem);
|
||||
BIO_read(bmem, buffer, s.size());
|
||||
BIO_free_all(bmem);
|
||||
|
||||
Reference in New Issue
Block a user