using System.Security.Cryptography;
public static void Main()
var hashAlgorithm = new SHA256CryptoServiceProvider();
byte[] byteValue = System.Text.Encoding.UTF8.GetBytes(key);
byte[] byteHash = hashAlgorithm.ComputeHash(byteValue);
var res = Convert.ToBase64String(byteHash);