Skip to content

Commit edbff10

Browse files
committed
* NuGet Updates
1 parent 5a7cff8 commit edbff10

62 files changed

Lines changed: 139 additions & 96 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView/Krypton.Toolkit.Suite.Extended.AdvancedDataGridView 2022.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<Choose>
7575
<When Condition="'$(Configuration)' == 'Nightly'">
7676
<ItemGroup>
77-
<PackageReference Include="Krypton.Standard.Toolkit.Nightly" Version="110.26.6.177-alpha" />
77+
<PackageReference Include="Krypton.Standard.Toolkit.Nightly" Version="110.26.6.180-alpha" />
7878
</ItemGroup>
7979
</When>
8080

Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.BottomSheet/Krypton.Toolkit.Suite.Extended.BottomSheet.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
<Choose>
7373
<When Condition="'$(Configuration)' == 'Nightly'">
7474
<ItemGroup>
75-
<PackageReference Include="Krypton.Standard.Toolkit.Nightly" Version="110.26.6.177-alpha" />
75+
<PackageReference Include="Krypton.Standard.Toolkit.Nightly" Version="110.26.6.180-alpha" />
7676
</ItemGroup>
7777
</When>
7878

Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Buttons/Krypton.Toolkit.Suite.Extended.Buttons 2022.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
<Choose>
7373
<When Condition="'$(Configuration)' == 'Nightly'">
7474
<ItemGroup>
75-
<PackageReference Include="Krypton.Standard.Toolkit.Nightly" Version="110.26.6.177-alpha" />
75+
<PackageReference Include="Krypton.Standard.Toolkit.Nightly" Version="110.26.6.180-alpha" />
7676
</ItemGroup>
7777
</When>
7878

Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Calendar/Krypton.Toolkit.Suite.Extended.Calendar 2022.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
<Choose>
7373
<When Condition="'$(Configuration)' == 'Nightly'">
7474
<ItemGroup>
75-
<PackageReference Include="Krypton.Standard.Toolkit.Nightly" Version="110.26.6.177-alpha" />
75+
<PackageReference Include="Krypton.Standard.Toolkit.Nightly" Version="110.26.6.180-alpha" />
7676
</ItemGroup>
7777
</When>
7878

Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Card/Krypton.Toolkit.Suite.Extended.Card.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
<Choose>
7373
<When Condition="'$(Configuration)' == 'Nightly'">
7474
<ItemGroup>
75-
<PackageReference Include="Krypton.Standard.Toolkit.Nightly" Version="110.26.6.177-alpha" />
75+
<PackageReference Include="Krypton.Standard.Toolkit.Nightly" Version="110.26.6.180-alpha" />
7676
</ItemGroup>
7777
</When>
7878

Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Classes/HashingHelpers.cs

Lines changed: 61 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,24 @@ public static SafeNETCoreAndNewerSupportedHashAlgorithims ReturnHashType(string
5959
};
6060
#endif
6161

62+
/// <summary>
63+
/// Builds a string representation of the MD5 hash from the given byte array.
64+
/// </summary>
65+
/// <param name="hashBytes">The byte array containing the hash value.</param>
66+
/// <returns>A string representing the MD5 hash.</returns>
6267
public static string BuildMD5HashString(byte[]? hashBytes)
6368
{
6469
CheckHashBytesNull(hashBytes);
6570

66-
// Set aside 32 bits in memory, for the total string length of the MD5 hash
71+
// Set aside 32 bits in memory, for the total string length of the MD5 hash
6772
StringBuilder builder = new StringBuilder(32);
6873

69-
foreach (byte b in hashBytes)
74+
if (hashBytes != null)
7075
{
71-
builder.Append(b.ToString("X2"));
76+
foreach (byte b in hashBytes)
77+
{
78+
builder.Append(b.ToString("X2"));
79+
}
7280
}
7381

7482
return builder.ToString();
@@ -82,76 +90,116 @@ private static void CheckHashBytesNull(byte[]? hashBytes)
8290
}
8391
}
8492

93+
/// <summary>
94+
/// Builds a string representation of the SHA-1 hash from the given byte array.
95+
/// </summary>
96+
/// <param name="hashBytes">The byte array containing the hash value.</param>
97+
/// <returns>A string representing the SHA-1 hash.</returns>
8598
public static string BuildSHA1HashString(byte[]? hashBytes)
8699
{
87100
CheckHashBytesNull(hashBytes);
88101

89102
// Set aside 40 bits in memory, for the total string length of the SHA-1 hash
90103
StringBuilder builder = new StringBuilder(40);
91104

92-
foreach (byte b in hashBytes)
105+
if (hashBytes != null)
93106
{
94-
builder.Append(b.ToString("X2"));
107+
foreach (byte b in hashBytes)
108+
{
109+
builder.Append(b.ToString("X2"));
110+
}
95111
}
96112

97113
return builder.ToString();
98114
}
99115

116+
/// <summary>
117+
/// Builds a string representation of the SHA-256 hash from the given byte array.
118+
/// </summary>
119+
/// <param name="hashBytes">The byte array containing the hash value.</param>
120+
/// <returns>A string representing the SHA-256 hash.</returns>
100121
public static string BuildSHA256HashString(byte[]? hashBytes)
101122
{
102123
CheckHashBytesNull(hashBytes);
103124

104125
// Set aside 64 bits in memory, for the total string length of the SHA-256 hash
105126
StringBuilder builder = new StringBuilder(64);
106127

107-
foreach (byte b in hashBytes)
128+
if (hashBytes != null)
108129
{
109-
builder.Append(b.ToString("X2"));
130+
foreach (byte b in hashBytes)
131+
{
132+
builder.Append(b.ToString("X2"));
133+
}
110134
}
111135

112136
return builder.ToString();
113137
}
114138

139+
/// <summary>
140+
/// Builds a string representation of the SHA-384 hash from the given byte array.
141+
/// </summary>
142+
/// <param name="hashBytes">The byte array containing the hash value.</param>
143+
/// <returns>A string representing the SHA-384 hash.</returns>
115144
public static string BuildSHA384HashString(byte[]? hashBytes)
116145
{
117146
CheckHashBytesNull(hashBytes);
118147

119148
// Set aside 96 bits in memory, for the total string length of the SHA-384 hash
120149
StringBuilder builder = new StringBuilder(96);
121150

122-
foreach (byte b in hashBytes)
151+
if (hashBytes != null)
123152
{
124-
builder.Append(b.ToString("X2"));
153+
foreach (byte b in hashBytes)
154+
{
155+
builder.Append(b.ToString("X2"));
156+
}
125157
}
126158

127159
return builder.ToString();
128160
}
129161

162+
/// <summary>
163+
/// Builds a string representation of the SHA-512 hash from the given byte array.
164+
/// </summary>
165+
/// <param name="hashBytes">The byte array containing the hash value.</param>
166+
/// <returns>A string representing the SHA-512 hash.</returns>
130167
public static string BuildSHA512HashString(byte[]? hashBytes)
131168
{
132169
CheckHashBytesNull(hashBytes);
133170

134171
// Set aside 128 bits in memory, for the total string length of the SHA-512 hash
135172
StringBuilder builder = new StringBuilder(128);
136173

137-
foreach (byte b in hashBytes)
174+
if (hashBytes != null)
138175
{
139-
builder.Append(b.ToString("X2"));
176+
foreach (byte b in hashBytes)
177+
{
178+
builder.Append(b.ToString("X2"));
179+
}
140180
}
141181

142182
return builder.ToString();
143183
}
144184

185+
/// <summary>
186+
/// Builds a string representation of the RIPEMD-160 hash from the given byte array.
187+
/// </summary>
188+
/// <param name="hashBytes">The byte array containing the hash value.</param>
189+
/// <returns>A string representing the RIPEMD-160 hash.</returns>
145190
public static string BuildRIPEMD160HashString(byte[]? hashBytes)
146191
{
147192
CheckHashBytesNull(hashBytes);
148193

149194
// Set aside 40 bits in memory, for the total string length of the RIPEMD-160 hash
150195
StringBuilder builder = new StringBuilder(40);
151196

152-
foreach (byte b in hashBytes)
197+
if (hashBytes != null)
153198
{
154-
builder.Append(b.ToString("X2"));
199+
foreach (byte b in hashBytes)
200+
{
201+
builder.Append(b.ToString("X2"));
202+
}
155203
}
156204

157205
return builder.ToString();

Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Classes/HelperMethods.cs

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,36 +29,31 @@ namespace Krypton.Toolkit.Suite.Extended.CheckSum.Tools;
2929

3030
public class HelperMethods
3131
{
32-
#region Variables
33-
private string[] _hashTypes = ["MD5", "SHA1", "SHA256", "SHA384", "SHA512", "RIPEMD160"], _safeNETCoreAndNewerHashTypes =
34-
["MD5", "SHA1", "SHA256", "SHA384", "SHA512"];
35-
#endregion
36-
37-
#region Properties
38-
public string[] HashTypes => _hashTypes;
32+
#region Properties
33+
public string[] HashTypes { get; } = ["MD5", "SHA1", "SHA256", "SHA384", "SHA512", "RIPEMD160"];
3934

40-
public string[] SafeNetCoreAndNewerHashTypes => _safeNETCoreAndNewerHashTypes;
35+
public string[] SafeNetCoreAndNewerHashTypes { get; } = ["MD5", "SHA1", "SHA256", "SHA384", "SHA512"];
4136

4237
#endregion
4338

44-
#region Methods
45-
public static void PropagateHashBox(KryptonComboBox hashBox)
46-
{
47-
HelperMethods helperMethods = new HelperMethods();
39+
#region Methods
40+
public static void PropagateHashBox(KryptonComboBox hashBox)
41+
{
42+
HelperMethods helperMethods = new HelperMethods();
4843

4944
#if NETCOREAPP3_0_OR_GREATER
50-
foreach (string hashType in helperMethods.SafeNetCoreAndNewerHashTypes)
51-
{
52-
hashBox.Items.Add(hashType);
53-
}
45+
foreach (string hashType in helperMethods.SafeNetCoreAndNewerHashTypes)
46+
{
47+
hashBox.Items.Add(hashType);
48+
}
5449
#else
55-
foreach (string hashType in helperMethods.HashTypes)
56-
{
57-
hashBox.Items.Add(hashType);
58-
}
50+
foreach (string hashType in helperMethods.HashTypes)
51+
{
52+
hashBox.Items.Add(hashType);
53+
}
5954
#endif
60-
}
55+
}
6156

62-
public static bool IsValid(string fileCheckSum, string checkSumToCompare) => checkSumToCompare.Contains(fileCheckSum);
63-
#endregion
57+
public static bool IsValid(string fileCheckSum, string checkSumToCompare) => checkSumToCompare.Contains(fileCheckSum);
58+
#endregion
6459
}

Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.CheckSum.Tools/Krypton.Toolkit.Suite.Extended.CheckSum.Tools 2022.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<Choose>
7575
<When Condition="'$(Configuration)' == 'Nightly'">
7676
<ItemGroup>
77-
<PackageReference Include="Krypton.Standard.Toolkit.Nightly" Version="110.26.6.177-alpha" />
77+
<PackageReference Include="Krypton.Standard.Toolkit.Nightly" Version="110.26.6.180-alpha" />
7878
</ItemGroup>
7979
</When>
8080

Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar/Krypton.Toolkit.Suite.Extended.Circular.ProgressBar 2022.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<Choose>
7575
<When Condition="'$(Configuration)' == 'Nightly'">
7676
<ItemGroup>
77-
<PackageReference Include="Krypton.Standard.Toolkit.Nightly" Version="110.26.6.177-alpha" />
77+
<PackageReference Include="Krypton.Standard.Toolkit.Nightly" Version="110.26.6.180-alpha" />
7878
</ItemGroup>
7979
</When>
8080

Source/Krypton Toolkit/Krypton.Toolkit.Suite.Extended.ComboBox/Krypton.Toolkit.Suite.Extended.ComboBox 2022.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
<Choose>
7575
<When Condition="'$(Configuration)' == 'Nightly'">
7676
<ItemGroup>
77-
<PackageReference Include="Krypton.Standard.Toolkit.Nightly" Version="110.26.6.177-alpha" />
77+
<PackageReference Include="Krypton.Standard.Toolkit.Nightly" Version="110.26.6.180-alpha" />
7878
</ItemGroup>
7979
</When>
8080

0 commit comments

Comments
 (0)