fork download
  1. using System;
  2. using System.Security.Cryptography;
  3.  
  4. public class Test
  5. {
  6. public static void Main()
  7. {
  8.  
  9. String publicKeyBase64 = "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEtNSk8o3dmCMY9CPj4f5ZeQkwBk91qZNJqe6/qc72KuX3hcUMxOn63czNmeljiDQKgkc6C4lNGJ0H+1MScSRtzg==";
  10.  
  11. byte[] publicKey = Convert.FromBase64String(publicKeyBase64);
  12. SHA256 sha256 = SHA256Managed.Create();
  13. byte[] hash = sha256.ComputeHash(publicKey);
  14. String publicKeyHash = Convert.ToBase64String(hash);
  15.  
  16. Console.WriteLine("Result: {0}", publicKeyHash);
  17. }
  18. }
Success #stdin #stdout 0.06s 27628KB
stdin
Standard input is empty
stdout
Result: Wzt4Vu+CTsVxO0xoJWbBlTrCg20GQVbCviwT/jfXxSA=