Пример #1
0
 private static string GenerateChecksum(string uri)
 {
     lock (Locker)
     {
         using (var reader = _fileIO.OpenRead(_pathProvider.MapPath(uri)))
         {
             using (var sha1 = System.Security.Cryptography.SHA1.Create())
             {
                 var hash      = sha1.ComputeHash(reader);
                 var hashvalue = string.Join("", hash.Select(b => b.ToString("x2")).ToArray());
                 return(hashvalue);
             }
         }
     }
 }