diff --git a/src/dev/DevToys.Startup/Package.appxmanifest b/src/dev/DevToys.Startup/Package.appxmanifest
index 3bec993557..c7b45eb3be 100644
--- a/src/dev/DevToys.Startup/Package.appxmanifest
+++ b/src/dev/DevToys.Startup/Package.appxmanifest
@@ -1,4 +1,4 @@
-
+
+
diff --git a/src/dev/impl/DevToys/LanguageManager.cs b/src/dev/impl/DevToys/LanguageManager.cs
index 731ffd521d..ba2ed3efe1 100644
--- a/src/dev/impl/DevToys/LanguageManager.cs
+++ b/src/dev/impl/DevToys/LanguageManager.cs
@@ -412,6 +412,16 @@ public class CheckSumGeneratorStrings : ObservableObject
/// Gets the resource SearchKeywords.
///
public string SearchKeywords => _resources.GetString("SearchKeywords");
+
+ ///
+ /// Gets the resource HashesMatch.
+ ///
+ public string HashesMatch => _resources.GetString("HashesMatch");
+
+ ///
+ /// Gets the resource HashesMismatch.
+ ///
+ public string HashesMismatch => _resources.GetString("HashesMismatch");
}
public class ColorBlindnessSimulatorStrings : ObservableObject
diff --git a/src/dev/impl/DevToys/Models/HashComparisonResult.cs b/src/dev/impl/DevToys/Models/HashComparisonResult.cs
new file mode 100644
index 0000000000..83131bf5e7
--- /dev/null
+++ b/src/dev/impl/DevToys/Models/HashComparisonResult.cs
@@ -0,0 +1,38 @@
+#nullable enable
+
+using Microsoft.UI.Xaml.Controls;
+
+namespace DevToys.Models
+{
+ ///
+ /// Contains information regarding the result of the hash comparison.
+ ///
+ internal sealed class HashComparisonResult
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ /// The severity of the comparison result message
+ /// The message that can be shown to the user
+ internal HashComparisonResult(InfoBarSeverity severity, string message)
+ {
+ Severity = severity;
+ Message = message;
+ }
+
+ ///
+ /// Gets a value that represents the severity of the comparison result message
+ ///
+ public InfoBarSeverity Severity { get; }
+
+ ///
+ /// Gets a value that represents the message can be shown to the user
+ ///
+ public string Message { get; }
+
+ ///
+ /// Gets the default-empty comparison result.
+ ///
+ public static HashComparisonResult? None { get; }
+ }
+}
diff --git a/src/dev/impl/DevToys/Strings/cs-CZ/CheckSumGenerator.resw b/src/dev/impl/DevToys/Strings/cs-CZ/CheckSumGenerator.resw
index f43258230e..7de31d954e 100644
--- a/src/dev/impl/DevToys/Strings/cs-CZ/CheckSumGenerator.resw
+++ b/src/dev/impl/DevToys/Strings/cs-CZ/CheckSumGenerator.resw
@@ -156,4 +156,10 @@
+
+ The hashes are the same.
+
+
+ The hashes are different.
+
\ No newline at end of file
diff --git a/src/dev/impl/DevToys/Strings/de-DE/CheckSumGenerator.resw b/src/dev/impl/DevToys/Strings/de-DE/CheckSumGenerator.resw
index 0e31a46529..0430af8b0d 100644
--- a/src/dev/impl/DevToys/Strings/de-DE/CheckSumGenerator.resw
+++ b/src/dev/impl/DevToys/Strings/de-DE/CheckSumGenerator.resw
@@ -156,4 +156,10 @@
+
+ The hashes are the same.
+
+
+ The hashes are different.
+
\ No newline at end of file
diff --git a/src/dev/impl/DevToys/Strings/en-US/CheckSumGenerator.resw b/src/dev/impl/DevToys/Strings/en-US/CheckSumGenerator.resw
index 0e31a46529..0430af8b0d 100644
--- a/src/dev/impl/DevToys/Strings/en-US/CheckSumGenerator.resw
+++ b/src/dev/impl/DevToys/Strings/en-US/CheckSumGenerator.resw
@@ -156,4 +156,10 @@
+
+ The hashes are the same.
+
+
+ The hashes are different.
+
\ No newline at end of file
diff --git a/src/dev/impl/DevToys/Strings/es-AR/CheckSumGenerator.resw b/src/dev/impl/DevToys/Strings/es-AR/CheckSumGenerator.resw
index 0e31a46529..0430af8b0d 100644
--- a/src/dev/impl/DevToys/Strings/es-AR/CheckSumGenerator.resw
+++ b/src/dev/impl/DevToys/Strings/es-AR/CheckSumGenerator.resw
@@ -156,4 +156,10 @@
+
+ The hashes are the same.
+
+
+ The hashes are different.
+
\ No newline at end of file
diff --git a/src/dev/impl/DevToys/Strings/es-ES/CheckSumGenerator.resw b/src/dev/impl/DevToys/Strings/es-ES/CheckSumGenerator.resw
index 0e31a46529..0430af8b0d 100644
--- a/src/dev/impl/DevToys/Strings/es-ES/CheckSumGenerator.resw
+++ b/src/dev/impl/DevToys/Strings/es-ES/CheckSumGenerator.resw
@@ -156,4 +156,10 @@
+
+ The hashes are the same.
+
+
+ The hashes are different.
+
\ No newline at end of file
diff --git a/src/dev/impl/DevToys/Strings/fr-FR/CheckSumGenerator.resw b/src/dev/impl/DevToys/Strings/fr-FR/CheckSumGenerator.resw
index 0e31a46529..0430af8b0d 100644
--- a/src/dev/impl/DevToys/Strings/fr-FR/CheckSumGenerator.resw
+++ b/src/dev/impl/DevToys/Strings/fr-FR/CheckSumGenerator.resw
@@ -156,4 +156,10 @@
+
+ The hashes are the same.
+
+
+ The hashes are different.
+
\ No newline at end of file
diff --git a/src/dev/impl/DevToys/Strings/hu-HU/CheckSumGenerator.resw b/src/dev/impl/DevToys/Strings/hu-HU/CheckSumGenerator.resw
index 0e31a46529..5ea141a466 100644
--- a/src/dev/impl/DevToys/Strings/hu-HU/CheckSumGenerator.resw
+++ b/src/dev/impl/DevToys/Strings/hu-HU/CheckSumGenerator.resw
@@ -118,42 +118,48 @@
System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
- Checksum Generator tool
+ Checksum Generátor eszköz
- Cancel
+ Mégsem
- Configuration
+ Beállítások
- Generate a hash with Checksum based on a file
+ Hash készítése fájl alapján
- Select which hashing algorithm you want to use
+ Válassza ki a használni kívánt hash függvényt
- Hashing Algorithm
+ Hash függvény
- Input
+ Bemenet
Checksum
- Output
+ Kimenet
- Output Comparer
+ Összehasonlító eredmény
Checksum Generator
- Uppercase
+ Nagybetűs
+
+ A hashek megegyeznek.
+
+
+ A hashek nem egyeznek meg.
+
\ No newline at end of file
diff --git a/src/dev/impl/DevToys/Strings/id-ID/CheckSumGenerator.resw b/src/dev/impl/DevToys/Strings/id-ID/CheckSumGenerator.resw
index 9ee25ec691..de92a49d95 100644
--- a/src/dev/impl/DevToys/Strings/id-ID/CheckSumGenerator.resw
+++ b/src/dev/impl/DevToys/Strings/id-ID/CheckSumGenerator.resw
@@ -156,4 +156,10 @@
+
+ The hashes are the same.
+
+
+ The hashes are different.
+
\ No newline at end of file
diff --git a/src/dev/impl/DevToys/Strings/it-IT/CheckSumGenerator.resw b/src/dev/impl/DevToys/Strings/it-IT/CheckSumGenerator.resw
index bf272cacac..c6c6bd987b 100644
--- a/src/dev/impl/DevToys/Strings/it-IT/CheckSumGenerator.resw
+++ b/src/dev/impl/DevToys/Strings/it-IT/CheckSumGenerator.resw
@@ -156,4 +156,10 @@
+
+ The hashes are the same.
+
+
+ The hashes are different.
+
\ No newline at end of file
diff --git a/src/dev/impl/DevToys/Strings/ja-JP/CheckSumGenerator.resw b/src/dev/impl/DevToys/Strings/ja-JP/CheckSumGenerator.resw
index 46adebfe82..71ab71e7bf 100644
--- a/src/dev/impl/DevToys/Strings/ja-JP/CheckSumGenerator.resw
+++ b/src/dev/impl/DevToys/Strings/ja-JP/CheckSumGenerator.resw
@@ -156,4 +156,10 @@
Checksum
+
+ The hashes are the same.
+
+
+ The hashes are different.
+
\ No newline at end of file
diff --git a/src/dev/impl/DevToys/Strings/ko-KR/CheckSumGenerator.resw b/src/dev/impl/DevToys/Strings/ko-KR/CheckSumGenerator.resw
index 22986da1ed..83fa9345ff 100644
--- a/src/dev/impl/DevToys/Strings/ko-KR/CheckSumGenerator.resw
+++ b/src/dev/impl/DevToys/Strings/ko-KR/CheckSumGenerator.resw
@@ -156,4 +156,10 @@
Checksum
+
+ The hashes are the same.
+
+
+ The hashes are different.
+
\ No newline at end of file
diff --git a/src/dev/impl/DevToys/Strings/pl-PL/CheckSumGenerator.resw b/src/dev/impl/DevToys/Strings/pl-PL/CheckSumGenerator.resw
index 0e31a46529..0430af8b0d 100644
--- a/src/dev/impl/DevToys/Strings/pl-PL/CheckSumGenerator.resw
+++ b/src/dev/impl/DevToys/Strings/pl-PL/CheckSumGenerator.resw
@@ -156,4 +156,10 @@
+
+ The hashes are the same.
+
+
+ The hashes are different.
+
\ No newline at end of file
diff --git a/src/dev/impl/DevToys/Strings/pt-PT/CheckSumGenerator.resw b/src/dev/impl/DevToys/Strings/pt-PT/CheckSumGenerator.resw
index 504fb5d979..075d40aa2e 100644
--- a/src/dev/impl/DevToys/Strings/pt-PT/CheckSumGenerator.resw
+++ b/src/dev/impl/DevToys/Strings/pt-PT/CheckSumGenerator.resw
@@ -156,4 +156,10 @@
+
+ The hashes are the same.
+
+
+ The hashes are different.
+
\ No newline at end of file
diff --git a/src/dev/impl/DevToys/Strings/ru-RU/CheckSumGenerator.resw b/src/dev/impl/DevToys/Strings/ru-RU/CheckSumGenerator.resw
index 0e31a46529..0430af8b0d 100644
--- a/src/dev/impl/DevToys/Strings/ru-RU/CheckSumGenerator.resw
+++ b/src/dev/impl/DevToys/Strings/ru-RU/CheckSumGenerator.resw
@@ -156,4 +156,10 @@
+
+ The hashes are the same.
+
+
+ The hashes are different.
+
\ No newline at end of file
diff --git a/src/dev/impl/DevToys/Strings/zh-Hans/CheckSumGenerator.resw b/src/dev/impl/DevToys/Strings/zh-Hans/CheckSumGenerator.resw
index 5a1998bb69..b37611000e 100644
--- a/src/dev/impl/DevToys/Strings/zh-Hans/CheckSumGenerator.resw
+++ b/src/dev/impl/DevToys/Strings/zh-Hans/CheckSumGenerator.resw
@@ -156,4 +156,10 @@
+
+ The hashes are the same.
+
+
+ The hashes are different.
+
\ No newline at end of file
diff --git a/src/dev/impl/DevToys/Strings/zh-Hant/CheckSumGenerator.resw b/src/dev/impl/DevToys/Strings/zh-Hant/CheckSumGenerator.resw
index 7da99f9b0a..6f409fc5ff 100644
--- a/src/dev/impl/DevToys/Strings/zh-Hant/CheckSumGenerator.resw
+++ b/src/dev/impl/DevToys/Strings/zh-Hant/CheckSumGenerator.resw
@@ -156,4 +156,10 @@
+
+ The hashes are the same.
+
+
+ The hashes are different.
+
\ No newline at end of file
diff --git a/src/dev/impl/DevToys/ViewModels/Tools/Generators/CheckSumGenerator/CheckSumGeneratorToolViewModel.cs b/src/dev/impl/DevToys/ViewModels/Tools/Generators/CheckSumGenerator/CheckSumGeneratorToolViewModel.cs
index ce067605cf..11c8079b1f 100644
--- a/src/dev/impl/DevToys/ViewModels/Tools/Generators/CheckSumGenerator/CheckSumGeneratorToolViewModel.cs
+++ b/src/dev/impl/DevToys/ViewModels/Tools/Generators/CheckSumGenerator/CheckSumGeneratorToolViewModel.cs
@@ -21,6 +21,7 @@
using DevToys.Views.Tools.CheckSumGenerator;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using Microsoft.Toolkit.Mvvm.Input;
+using Microsoft.UI.Xaml.Controls;
using Windows.ApplicationModel.DataTransfer;
using Windows.Storage;
@@ -61,6 +62,7 @@ private static readonly SettingDefinition HashingAlgorithmSett
private bool _toolSuccessfullyWorked;
private bool _hasCancelledCalculation;
private bool _shouldDisplayProgress;
+ private HashComparisonResult? _hashComparisonResult;
private HashingAlgorithmDisplayPair? _outputHashingAlgorithm;
private readonly Queue _computationTaskQueue = new();
@@ -132,13 +134,27 @@ internal bool ShouldDisplayProgress
internal string? Output
{
get => _output;
- set => SetProperty(ref _output, value);
+ set
+ {
+ SetProperty(ref _output, value);
+ HashComparisonResult = EvaluateOutputComparisonResult(value, OutputComparer);
+ }
}
internal string? OutputComparer
{
get => _outputComparer;
- set => SetProperty(ref _outputComparer, value);
+ set
+ {
+ SetProperty(ref _outputComparer, value);
+ HashComparisonResult = EvaluateOutputComparisonResult(Output, value);
+ }
+ }
+
+ internal HashComparisonResult? HashComparisonResult
+ {
+ get => _hashComparisonResult;
+ private set => SetProperty(ref _hashComparisonResult, value);
}
///
@@ -343,5 +359,22 @@ private HashAlgorithm CreateHashAlgorithm(HashingAlgorithm hashingAlgorithm) =>
HashingAlgorithm.SHA512 => SHA512.Create(),
_ => throw new ArgumentException("Hash Algorithm not supported", nameof(HashingAlgorithm))
};
+
+ ///
+ /// Evaluates the Output Comparison.
+ ///
+ private HashComparisonResult? EvaluateOutputComparisonResult(string? output, string? comparerOutput)
+ {
+ if (!string.IsNullOrEmpty(output) && !string.IsNullOrEmpty(comparerOutput))
+ {
+ return string.Equals(output, comparerOutput, StringComparison.OrdinalIgnoreCase)
+ ? new HashComparisonResult(InfoBarSeverity.Success, Strings.HashesMatch)
+ : new HashComparisonResult(InfoBarSeverity.Error, Strings.HashesMismatch);
+ }
+ else
+ {
+ return HashComparisonResult.None;
+ }
+ }
}
}
diff --git a/src/dev/impl/DevToys/Views/Tools/Generators/CheckSumGenerator/CheckSumGeneratorToolPage.xaml b/src/dev/impl/DevToys/Views/Tools/Generators/CheckSumGenerator/CheckSumGeneratorToolPage.xaml
index 2563b9cd16..725bb4c023 100644
--- a/src/dev/impl/DevToys/Views/Tools/Generators/CheckSumGenerator/CheckSumGeneratorToolPage.xaml
+++ b/src/dev/impl/DevToys/Views/Tools/Generators/CheckSumGenerator/CheckSumGeneratorToolPage.xaml
@@ -13,6 +13,7 @@
+
@@ -80,8 +81,14 @@
+
+
+
diff --git a/src/dev/shared/SharedAssemblyInfo.cs b/src/dev/shared/SharedAssemblyInfo.cs
index 10b703abb9..6f8c30f649 100644
--- a/src/dev/shared/SharedAssemblyInfo.cs
+++ b/src/dev/shared/SharedAssemblyInfo.cs
@@ -1,4 +1,4 @@
-//------------------------------------------------------------------------------
+//------------------------------------------------------------------------------
//
// This code was generated by a tool.
//