fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Security.Cryptography;
  7.  
  8. namespace ConsoleApplication
  9. {
  10. class Program
  11. {
  12. static void Main(string[] args)
  13. {
  14.  
  15. byte[] pass = Encoding.ASCII.GetBytes("rosnicka");
  16. byte[] salt = Convert.FromBase64String("zxwqTy+XjaY=");
  17.  
  18. byte[] salted = new byte[pass.Length + salt.Length];
  19. Buffer.BlockCopy(pass, 0, salted, 0, pass.Length);
  20. Buffer.BlockCopy(salt, 0, salted, pass.Length, salt.Length);
  21. SHA256Managed hashstring = new SHA256Managed();
  22. var hash = Convert.ToBase64String(hashstring.ComputeHash(salted));
  23.  
  24. Console.WriteLine("Ref: 3jdt1+JL3MPmjYr2OoXdoUwNfuweuDCZa8/3g7SfsNg=");
  25. Console.WriteLine("Result: " + hash);
  26. }
  27. }
  28. }
Success #stdin #stdout 0.04s 23968KB
stdin
1
2
10
42
11
stdout
Ref:        3jdt1+JL3MPmjYr2OoXdoUwNfuweuDCZa8/3g7SfsNg=
Result:     3jdt1+JL3MPmjYr2OoXdoUwNfuweuDCZa8/3g7SfsNg=