using System.Collections.Generic;
using System.Security.Cryptography;
public static void Main()
byte Max = byte.MaxValue;
Random randNum = new Random();
byte[] result = new byte[10];
byte[] sha256 = {0x0,0x0};
var crypto = new SHA256CryptoServiceProvider();
for (int i = 0; i < result.Length; i++)
result[i] = (byte)randNum.Next(Min, Max);
sha256 = crypto.ComputeHash(result);
Console.WriteLine("attempts: " + attempts);
Console.WriteLine("Sha256: " + ByteArrayToString(sha256));
Console.WriteLine("Result: " + ByteArrayToString(result));
static string ByteArrayToString(byte[] ba)
StringBuilder hex = new StringBuilder(ba.Length * 2);
hex.AppendFormat("{0:x2}", b);