public void GetHashes(string file1, string file2, string hashAlgorithm = "sha256") { try { File1 = new FileHash(file1, hashAlgorithm); File2 = new FileHash(file2, hashAlgorithm); Task taskA = Task.Run(() => File1.ComputeHash()); Task taskB = Task.Run(() => File2.ComputeHash()); Task.WaitAll(new Task[] { taskA, taskB }); _hashesComputed = true; } catch (Exception ex) { throw new Exception("Unable to obtain hash information. Ex: " + ex.Message); } }
public HashComparer() { File1 = null; File2 = null; _hashesComputed = false; }
private void Reset() { File1 = null; File2 = null; _hashesComputed = false; }