fork download
  1. using System;
  2. using System.Security.Cryptography;
  3. using System.Text;
  4.  
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. var sha1 = new System.Security.Cryptography.SHA1Managed();
  10. var plaintextBytes = Encoding.Unicode.GetBytes("1981");
  11. var hashBytes = sha1.ComputeHash(plaintextBytes);
  12.  
  13. var sb = new StringBuilder();
  14. foreach (var hashByte in hashBytes)
  15. {
  16. sb.AppendFormat("{0:x2}", hashByte);
  17. }
  18.  
  19. var hashString = sb.ToString();
  20.  
  21. Console.WriteLine(hashString);
  22. }
  23. }
Success #stdin #stdout 0.02s 16388KB
stdin
Standard input is empty
stdout
128c108c5faef01fe0774db296d99f721f27bc33