日期:2014-05-16 浏览次数:20592 次
byte[] SHA256Data = Encoding.UTF8.GetBytes("12sa这个测试是s34");
HMACSHA256 Sha256 = new HMACSHA256();
byte[] Result = Sha256.ComputeHash(SHA256Data);
Console.WriteLine(Convert.ToBase64String(Result));
byte[] bytes;
SHA256 sha256 = new SHA256Managed();
bytes = sha256.ComputeHash(new UTF8Encoding().GetBytes(str));
bytes = sha256.Hash;
sha256.Clear();
return BitConverter.ToString(bytes).Replace("-", "").ToLower();