fork download
  1. using System;
  2. using System.Globalization;
  3. using System.Reflection;
  4. using System.Security.Cryptography;
  5. using System.Text;
  6.  
  7. public class Test
  8. {
  9. public static void Main(string[] args)
  10. {
  11. Type type = Type.GetType("Mono.Runtime");
  12. if (type != null)
  13. {
  14. MethodInfo displayName = type.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static);
  15.  
  16. if (displayName != null)
  17. {
  18. Console.WriteLine("Mono version: {0}", displayName.Invoke(null, null));
  19. }
  20. }
  21.  
  22. SHA512 shaM = new SHA512Managed();
  23. byte[] data = shaM.ComputeHash(Encoding.UTF8.GetBytes("password"));
  24.  
  25. StringBuilder sBuilder = new StringBuilder();
  26.  
  27. for (int i = 0; i < data.Length; i++)
  28. {
  29. sBuilder.Append(data[i].ToString("x2"));
  30. }
  31.  
  32. string stringyHash = sBuilder.ToString();
  33.  
  34. Console.WriteLine(stringyHash);
  35. }
  36. }
Success #stdin #stdout 0.06s 24024KB
stdin
Standard input is empty
stdout
Mono version: 4.0.2 (Stable 4.0.2.5/c99aa0c Wed Jun 24 10:12:58 UTC 2015)
b109f3bbbc244eb82441917ed06d618b9008dd09b3befd1b5e07394c706a8bb980b1d7785e5976ec049b46df5f1326af5a2ea6d103fd07c95385ffab0cacbc86