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 = "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEwKWZUnU+9uwIWZciNGr9+NEimc/AVUzX3S2sNTlpn9GeGJYVBhD4Frzm+dn/AH/jaMbDIMnjpnCzPUxznHDjCw==";
  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.04s 27740KB
stdin
Standard input is empty
stdout
Result: 0yA8flQyHgJo9aTmCnJOvMboSy3kBMWWLzXuTdb+378=