/// <summary>
/// 签名计算方法
/// </summary>
/// <param name="appSecret"></param>
/// <param name="timestamp"></param>
/// <returns></returns>
public static string hash_hmac2(string message, string secret)
{
secret = secret ?? "";
var encoding = new System.Text.ASCIIEncoding();
byte[] keyByte = encoding.GetBytes(secret);
byte[] messageBytes = encoding.GetBytes(message);
using (var hmacsha256 = new HMACSHA256(keyByte))
{
byte[] hashmessage = hmacsha256.ComputeHash(messageBytes);
return Convert.ToBase64String(hashmessage);
}
}