Kotucode's Base 项目
本项目提供了 C++ 接口的 Base62 和 Base64 相关的编解码方法。
载入中...
搜索中...
未找到
kotucode::base::base62 命名空间参考

函数

template<typename Alphabets = alphabet::base62>
std::string encode (const std::string &binary_data)
 将二进制数据编码为 Base62 字符串。
template<typename Alphabets = alphabet::base62>
std::string decode (const std::string &base_string)
 将 Base62 编码字符串解码为原始二进制数据。

函数说明

◆ decode()

template<typename Alphabets = alphabet::base62>
std::string kotucode::base::base62::decode ( const std::string & base_string)

将 Base62 编码字符串解码为原始二进制数据。

模板参数
Alphabets编码字符集类型,默认为 alphabet::base62。
参数
base_string待解码的字符串。
返回
解码后的二进制数据;若包含非法字符则返回空字符串。

◆ encode()

template<typename Alphabets = alphabet::base62>
std::string kotucode::base::base62::encode ( const std::string & binary_data)

将二进制数据编码为 Base62 字符串。

注意
若输入的二进制数据由数字类型指针转换而来, 应注意输入的数字需为大端序。
模板参数
Alphabets编码字符集类型,默认为 alphabet::base62。
参数
binary_data待编码的二进制字符串。
返回
编码后的字符串。