Beispiel #1
0
 private string FileHash(FileInfo file)
 {
     using (FileStream fileStream = file.OpenRead())
     {
         return(SecurityTools.GetMD5OfStream(fileStream));
     }
 }
Beispiel #2
0
 /// <summary>
 /// Returns true if the <see cref="FileMD5"/> matches the computed MD5 of the current <see cref="DataStream"/>.
 /// </summary>
 /// <returns></returns>
 public bool VerifyData()
 {
     if (dataStream != null)
     {
         streamMD5 = SecurityTools.GetMD5OfStream(dataStream);
         if (streamMD5 == fileMD5)
         {
             return(true);
         }
     }
     return(false);
 }