Skip to content

Instantly share code, notes, and snippets.

@David-Mimnagh
Created December 9, 2016 15:52
Show Gist options
  • Save David-Mimnagh/8a6b4ff2755e724370aad2733c4eadbb to your computer and use it in GitHub Desktop.
Save David-Mimnagh/8a6b4ff2755e724370aad2733c4eadbb to your computer and use it in GitHub Desktop.
do
{
Console.WriteLine("The index " + index + ".");
inputCopy = input;
inputCopy += index.ToString();
data = md5Hash.ComputeHash(Encoding.UTF8.GetBytes(inputCopy));
System.Text.StringBuilder sBuilder = new StringBuilder();
for (int i = 0; i < data.Length; i++)
{
sBuilder.Append(data[i].ToString("x2"));
}
string hash = sBuilder.ToString();
if (hash.StartsWith("00000"))
{
char pos = hash[5];
if (Char.IsNumber(pos))
{
if (dataList.Count > 0)
{
for (int i = 0; i < dataList.Count; i++)
{
char[] chars = dataList[i].ToCharArray();
if (chars[5] != pos)
possString = hash;
else
possString = "";
}
if (possString != "")
dataList.Add(possString);
}
else
dataList.Add(hash);
}
}
index++;
} while (dataList.Count < 8);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment