Beispiel #1
0
 public LocalFileIndex(bool useCache)
 {
     if (useCache && File.Exists(FILE_NAME))
     {
         try
         {
             this.FromFile(FILE_NAME);
             return;
         }
         catch
         {
         }
     }
     foreach (var file in Program.RequiredFiles)
     {
         if (!File.Exists(file))
         {
             continue;
         }
         using (var fs = new FileStream(file, FileMode.Open, FileAccess.Read))
         {
             this[file] = new MD5Sum(fs);
         }
     }
 }
Beispiel #2
0
 public bool Equals(MD5Sum other)
 {
     if (other == null)
     {
         return(false);
     }
     for (int i = 0; i < 16; ++i)
     {
         if (this.Hash[i] != other.Hash[i])
         {
             return(false);
         }
     }
     return(true);
 }