1 using System.Security.Cryptography;
 2 
 3   SHA256 mySHA256 = SHA256Managed.Create();
 4   byte[] ok = mySHA256.ComputeHash(System.Text.Encoding.Default.GetBytes(resp));
 5   System.Diagnostics.Debug.WriteLine(PrintByteArray(ok));
 6 
 7    private string PrintByteArray(byte[] array)
 8    {
 9        string ret = "";
10        for (int i = 0; i < array.Length; i++)
11        {
12            ret += String.Format("{0:X2}", array[i]);
13            //if ((i % 4) == 3) ret += " ";
14        }
15        return ret;
16    }

resp is a string.

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案