title: SHA1 File Hash in Classic ASP or ASP.NET
body: <p>I have a website that allows users to upload files which are in turn stored in a Microsoft SQL Database. </p>
  
  <p>The database contains hundreds of thousands of images and is becoming unmanagable. As such I've written a powershell script that extracts those images from the database to the filesystem and then generates a SHA1 hash of the file as such:</p>
  
  <p>$SHA1 = Get-Checksum -Algorithm sha1 -File ($Dest + "$i.jpg")</p>
  
  <p>Going forward I no longer want to store images in the database but rather use the file system however I still need to generate SHA1 hashes of each file. </p>
  
  <p>I've been unable to find any documentation on generating SHA1 file hashes in classic asp or asp.net (c# or vb.net). </p>
  
  <p><strong>Note I specifically need to know how to generate <em>FILE HASHES</em> - not hashes of strings.</strong></p>
  
  <p>Has anyone else done this or know if or how it can be done? Any example code you could provide would be greatly appreciated.</p>
  
  <p>Thanks
  Brad</p>