File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -135,15 +135,29 @@ public CredentialType CredentialType
135135 /// <returns>encoded b64 hash</returns>
136136 public string CreateHash ( string input )
137137 {
138+ if ( string . IsNullOrEmpty ( input ) )
139+ throw new ArgumentException ( "Input cannot be null or empty" , nameof ( input ) ) ;
140+
138141 var inputBytes = Encoding . UTF8 . GetBytes ( input ) ;
139142
140- var hashBytes = CredentialSettings . HashAlgorithm . ComputeHash ( inputBytes ) ;
143+ using var hashAlgorithm = SHA1 . Create ( ) ;
141144
145+ var hashBytes = hashAlgorithm . ComputeHash ( inputBytes ) ;
142146 var encodedBytes = hashBytes . ToBase64String ( ) ;
143147
144148 return encodedBytes ;
145149 }
146150
151+ //public string CreateHash(string input)
152+ //{
153+ // var inputBytes = Encoding.UTF8.GetBytes(input);
154+
155+ // var hashBytes = CredentialSettings.HashAlgorithm.ComputeHash(inputBytes);
156+
157+ // var encodedBytes = hashBytes.ToBase64String();
158+
159+ // return encodedBytes;
160+ //}
147161
148162 /// <summary>
149163 /// Verify a hash against a string.
Original file line number Diff line number Diff line change 22
33 <PropertyGroup >
44 <TargetFrameworks >net6.0;net8.0;net9.0</TargetFrameworks >
5- <Version >4.0.95 </Version >
5+ <Version >4.0.96 </Version >
66 <AssemblyVersion >$(Version)</AssemblyVersion >
77 <FileVersion >$(Version)</FileVersion >
88 <PackageVersion >$(Version)</PackageVersion >
You can’t perform that action at this time.
0 commit comments