title: MD5 ComputeHash returning duplicate hash
body: <p>I'm trying to compute an MD5 hash using an HttpPostedFile's InputStream.</p>
  
  <p>There aren't any issues creating the hash or converting the hash.
  However, the hash is the same, no matter what file I upload (using ASP FileUpload control).</p>
  
  <p>I saw a solution involving setting the Stream.Position = 0 before ComputeHash, but it is still the same.</p>
  
  <p>Is HttpPostedFile.InputStream always going to create the same MD5 hash or is there something I am missing in my code?</p>
  
  <p>I'd appreciate any suggestions. Thanks in advance.</p>
  
  <pre><code>private static string GetMd5FileHash(HttpPostedFile file)
      {
          using (var md5 = MD5.Create())
          {
              file.InputStream.Position = 0;
              var hash = md5.ComputeHash(file.InputStream);
              return Convert.ToBase64String(hash);
          }
      }
  </code></pre>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Just discovered that the MD5 hash I've been receiving is generic, which probably means it's not reading the InputStream.</p>