Skip to content

Commit f1ae704

Browse files
committed
feat: add code documentation for GenerateRandomIVKeyAsString method
1 parent 7f41ac1 commit f1ae704

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/Helpers/KeyGenerators.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ public static byte[] GenerateRandomIVKeyAsBytes(int length)
3030
return randomBytes;
3131
}
3232

33+
/// <summary>
34+
/// Generates a random initialization vector (IV) key as a hexadecimal string.
35+
/// </summary>
36+
/// <returns>
37+
/// A hexadecimal string representation of the randomly generated IV key.
38+
/// </returns>
39+
/// <remarks>
40+
/// This method internally uses the <see cref="GenerateRandomIVKeyAsBytes"/> method
41+
/// to obtain a random byte array and then converts it to a hexadecimal string using
42+
/// <see cref="BitConverter.ToString"/>. Any hyphens in the resulting string are removed
43+
/// using <see cref="string.Replace"/>.
44+
/// </remarks>
3345
public static string GenerateRandomIVKeyAsString()
3446
{
3547
byte[] randomBytes = GenerateRandomIVKeyAsBytes(16);

0 commit comments

Comments
 (0)