- md5加密和base64编解码的实现分别为两个类,即.h文件和.cpp文件,无需任何外部库,可直接复制调用。
- base64编解码的调用方式如下:
#include "Cbase64.h" #include <iostream> int main() { const std::string s = "需要编码的字符串" ; std::string encoded = base64_encode(reinterpret_cast<const unsigned char*>(s.c_str()), s.length()); std::string decoded = base64_decode(encoded); std::cout << "encoded: " << encoded << std::endl; std::cout << "decoded: " << decoded << std::endl; return 0; }
- md5加密的调用方式如下:
Md5Encode enco
在VS下用原生C++实现可直接调用的md5加密及base64编解码
于 2022-01-30 12:14:34 首次发布