@@ -104,7 +104,6 @@ string decryptedText = Encoding.UTF8.GetString(outputStream.ToArray());
104104 encrypting emails in your software and also want that emails to be unique. With our Aes256 class by default your
105105 emails will be unique as in front will be the unique hash.
106106
107-
108107### Argon2id Class
109108
110109** Default Configurations**
@@ -149,22 +148,24 @@ bool isValid = Password.Validate(password, 16, includeUppercase, includeLowercas
149148
150149### Sha2 Class
151150
152- The ` Sha2 ` class simplifies HMAC-SHA256 operations by offering byte array, hex, and Base64 outputs.
151+ The ` Sha2 ` class simplifies HMAC-SHA256 operations by offering byte array, hex, and Base64 outputs. It also hat params
152+ string[ ] where the method automatically concatenates all strings and then computes the hash.
153153
154154``` csharp
155155// Prepare the key and message
156- var key = Encoding .UTF8 .GetBytes (" your-secret-key" );
157- var message = " HelloWorld" ;
156+ var key = Encoding .UTF8 .GetBytes (" secret" );
157+ var message1 = " Hello" ;
158+ var message2 = " World" ;
158159
159160// Compute HMAC-SHA256 as a byte array
160- byte [] hashBytes = Sha2 .ComputeHmacSha256 (key , message );
161+ byte [] hashBytes = Sha2 .ComputeHmacSha256 (key , message1 , message2 );
161162
162163// Get HMAC-SHA256 as a hex string
163- string hexHash = Sha2 .GetHmacSha256Hex (key , message );
164+ string hexHash = Sha2 .GetHmacSha256Hex (key , message1 , message2 );
164165// Output: 2e91612bb72b29d82f32789d063de62d5897a4ee5d3b5d34459801b94397b099
165166
166167// Get HMAC-SHA256 as a Base64 string
167- string base64Hash = Sha2 .GetHmacSha256Base64 (key , message );
168+ string base64Hash = Sha2 .GetHmacSha256Base64 (key , message1 , message2 );
168169// Output: LpFhK7crKdgvMnidBj3mLViXpO5dO100RZgBuUOXsJk=
169170```
170171
0 commit comments