title: Generate Running Hash (or Checksum) in C#?
body: <p>Preface:</p>
  
  <p>I am doing a data-import that has a verify-commit phase. The idea is that: the first phase allows taking data from various sources and then running various insert/update/validate operations on a database. The commit is rolled back but a "verification hash/checksum" is generated. The commit phase is the same, but, if the "verification hash/checksum" is the same then the operations will be committed. (The database will be running under the appropriate isolation levels.)</p>
  
  <p>Restrictions:</p>
  
  <ul>
  <li>Input reading and operations are forward-read-once only</li>
  <li>Do not want to pre-create a stream (e.g. writing to MemoryStream not desirable) as there may be <em>a lot</em> of data. (It would work on our servers/load, but pretend memory is limited.)</li>
  <li>Do not want to "create my own". (I am aware of available code like <a href="http://damieng.com/blog/2006/08/08/calculating_crc32_in_c_and_net" rel="nofollow">CRC-32 by Damien</a> which I could use/modify but would prefer something "standard".)</li>
  </ul>
  
  <p>And what I (think I am) looking for:</p>
  
  <p>A way to generate a Hash (e.g. SHA1 or MD5?) or a Checksum (e.g. CRC32 but hopefully more) based on input + operations. (The input/operations could themselves be hashed to values more fitting to the checksum generation but it would be nice just to be able to "write to steam".)</p>
  
  <p>So, the question is:</p>
  
  <p><strong>How to generate a Running Hash (or Checksum) in C#?</strong></p>
  
  <p>Also, while there are CRC32 implementations that can be modified for a Running operation, what about running SHAx or MD5 hashes?</p>
  
  <p>Am I missing some sort of handy Stream approach than could be used as an adapter?</p>
  
  <p>(Critiques are welcome, but please also answer the above as applicable. Also, I would prefer not to deal with threads. ;-)</p>