本文整理汇总了C++中cryptopp::HexEncoder::Get方法的典型用法代码示例。如果您正苦于以下问题:C++ HexEncoder::Get方法的具体用法?C++ HexEncoder::Get怎么用?C++ HexEncoder::Get使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cryptopp::HexEncoder
的用法示例。
在下文中一共展示了HexEncoder::Get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: node
// --------------------------------------------------------------------------
document::document () :
node(std::shared_ptr<document>(this, [](document*){})),
m_implementation(m_document)
// --------------------------------------------------------------------------
{
m_html = false;
m_mode = no_quirks_mode;
m_content_type = "application/xml";
m_encoding = "utf-8";
m_url = "about:blank";
if (global_object)
{
m_origin = global_object->m_document->m_origin;
m_script_origin = global_object->m_document->m_script_origin;
}
else
{
// Default is a globally unique identifier.
// We'll just generate 32 random bytes as the ID.
CryptoPP::AutoSeededRandomPool rng;
CryptoPP::HexEncoder enc;
byte bin[32];
char hex[64];
rng.GenerateBlock(bin, 32);
enc.PutMessageEnd(bin, 32);
enc.Get(reinterpret_cast<byte*>(hex), 64);
m_origin = hex;
m_script_origin = m_origin;
}
}
示例2: s3fs_keyform
int s3fs_keyform(byte* outkey, string inkey)
{
CryptoPP::HexEncoder encoder;
encoder.Put((byte*)inkey.c_str(), inkey.length());
encoder.MessageEnd();
encoder.Get(outkey, CryptoPP::AES::DEFAULT_KEYLENGTH);
return 0;
}
示例3: to_string
std::string to_string(Hash const& hash)
{
CryptoPP::HexEncoder enc;
enc.Put(reinterpret_cast<byte const*>(hash.digest.data()), hash.digest.size());
std::array<char, 2*std::tuple_size<decltype(hash.digest)>::value + 1> buffer;
auto const res = enc.Get(reinterpret_cast<byte*>(buffer.data()), 2*hash.digest.size());
GHULBUS_ASSERT(res == 2*hash.digest.size());
buffer.back() = '\0';
return std::string(begin(buffer), end(buffer));
}
示例4: cache_file
fs::path http_cache::cache_file (const std::string& url) const
{
std::array<uint8_t, 32> digest;
CryptoPP::SHA().CalculateDigest(digest.data(),
reinterpret_cast<const uint8_t*>(&url[0]),
url.size());
CryptoPP::HexEncoder hex;
hex.Put(digest.data(), digest.size());
std::string hexstr;
hexstr.resize(64);
hex.Get(reinterpret_cast<uint8_t*>(&hexstr[0]), 64);
return dir_ / hexstr;
}
示例5: encodeHex
void encodeHex(const byte * inString1, byte * inString2,const size_t length){
CryptoPP::HexEncoder hexEncoder;
hexEncoder.Put(inString1,length);
hexEncoder.MessageEnd();
hexEncoder.Get(inString2,length*2);
}