当前位置: 首页>>代码示例>>C++>>正文


C++ HexEncoder::Get方法代码示例

本文整理汇总了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;
  }
}
开发者ID:fumu-no-kagomeko,项目名称:libkueea-dom,代码行数:35,代码来源:document.cpp

示例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; 
}
开发者ID:mklim,项目名称:crypto-s3fs-fuse,代码行数:8,代码来源:crypt.cpp

示例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));
}
开发者ID:ComicSansMS,项目名称:blimp,代码行数:10,代码来源:file_hash.cpp

示例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;
}
开发者ID:friederschueler,项目名称:hexahedra,代码行数:13,代码来源:http_cache.cpp

示例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);
}
开发者ID:varren,项目名称:Cryptography,代码行数:6,代码来源:Week2ProgrammingAssignment.cpp


注:本文中的cryptopp::HexEncoder::Get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。