标签:decode odi 编码 ram param string public turn sum
/// <summary>
/// 实现Base64加密解密
/// </summary>
public sealed class Base64
{
/// <summary>
/// BASE64编码加密
/// </summary>
/// <param name="s"></param>
/// <param name="encode"></param>
/// <returns></returns>
public static string Base64Encode(string s, string encode)
{
return Convert.ToBase64String(Encoding.GetEncoding(encode).GetBytes(s));
}
/// <summary>
/// BASE64编码解密
/// </summary>
/// <param name="s"></param>
/// <param name="encode"></param>
/// <returns></returns>
public static string Base64Decode(string s, string encode)
{
return Encoding.GetEncoding(encode).GetString(Convert.FromBase64String(s));
}
}
注:encode传utf-8,s传需加密的值
标签:decode odi 编码 ram param string public turn sum
原文地址:https://www.cnblogs.com/tfeblog/p/12956022.html