title: Faster MD5 alternative?
body: <p>I'm working on a program that searches entire drives for a given file. At the moment, I calculate an MD5 hash for the known file and then scan all files recursively, looking for a match.</p>
  
  <p>The only problem is that MD5 is painfully slow on large files. Is there a faster alternative that I can use while retaining a very small probablity of false positives?</p>
  
  <p>All code is in C#.</p>
  
  <p>Thank you.</p>
  
  <p><strong>Update</strong></p>
  
  <p>I've read that even MD5 can be pretty quick and that disk I/O should be the limiting factor. That leads me to believe that my code might not be optimal. Are there any problems with this approach?</p>
  
  <pre><code>        MD5 md5 = MD5.Create();
          StringBuilder sb = new StringBuilder();
          try
          {
              using (FileStream fs = File.Open(fileName, FileMode.Open, FileAccess.Read))
              {
                  foreach (byte b in md5.ComputeHash(fs))
                      sb.Append(b.ToString("X2"));
              }
              return sb.ToString();
          }
          catch (Exception)
          {
              return "";
          }
  </code></pre>