public byte[] GetUTF8(string content)
{
byte[] bytes = Encoding.UTF8.GetBytes(content);
return bytes;
}
public byte[] GetHash(byte[] sources)
{
MD5CryptoServiceProvider MD5CSP = new MD5CryptoServiceProvider();
byte[] targets = MD5CSP.ComputeHash(sources);
return targets;
}
public string ConvertBase64(byte[] sources)
{
string value = Convert.ToBase64String(sources);
return value;
}
string body="hello234";
string data_digest = ConvertBase64(GetHash(GetUTF8(body + "key123")));
标签:Java,string,C#,base64,sources,return,byte,public From: https://www.cnblogs.com/yw-bk/p/17602924.html