Cryptopp BCD与字符互转

来自泡泡学习笔记
BrainBs讨论 | 贡献2025年1月31日 (五) 20:21的版本 (创建页面,内容为“ std::string fromHex(const std::string &from) { std::string to; CryptoPP::StringSource hexStringSource(from, true, new CryptoPP::HexDecoder(new CryptoPP::StringSink(to))); return to; } std::string toHex(const std::string &from) { std::string to; CryptoPP::StringSource hexStringSource(from, true, new CryptoPP::HexEncoder(new CryptoPP::StringSi…”)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳到导航 跳到搜索
std::string fromHex(const std::string &from) {
    std::string to;
    CryptoPP::StringSource hexStringSource(from, true,
                                           new CryptoPP::HexDecoder(new CryptoPP::StringSink(to))); 

    return to;
}


std::string toHex(const std::string &from) {
    std::string to;
    CryptoPP::StringSource hexStringSource(from, true,
                                           new CryptoPP::HexEncoder(new CryptoPP::StringSink(to))); 

    return to;
}