C# 非对称加密

public string sha256(string data)
{
   byte[] bytes = Encoding.UTF8.GetBytes(data);
   byte[] hash = SHA256Managed.Create().ComputeHash(bytes);
 
   StringBuilder builder = new StringBuilder();
   for (int i = 0; i < hash.Length; i++)
   {
          builder.Append(hash[i].ToString("X2"));
   }
 
   return builder.ToString();
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-17
  • 2022-12-23
  • 2022-03-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-23
相关资源
相似解决方案