title: C# Faster generation of MD5 hashes
body: <p>I have a project where I have been given a MD5 hash of a number between 1 and 2 billion, and I have to write a distributed program which obtains the number by brute force. I have successfully coded this program and it works. I was wondering if there is a way to speed up the generation of hashes?</p>
  
  <p>Here is my current function to generate the hashes:</p>
  
  <pre><code>    static string generateHash(string input)
      {
          MD5 md5Hasher = MD5.Create();
          byte[] data = md5Hasher.ComputeHash(Encoding.Default.GetBytes(input));
          StringBuilder sBuilder = new StringBuilder();
          for (int i = 0; i &lt; data.Length; i++)
          {
              sBuilder.Append(data[i].ToString("x2"));
          }
          return sBuilder.ToString();
      }
  </code></pre>
  
  <p>Thanks for any help </p>