We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5cfcef commit 451bfd4Copy full SHA for 451bfd4
src/KSFramework/Utilities/SecurityHelper.cs
@@ -16,9 +16,8 @@ public static string GetSha256Hash(string input)
16
17
public static string GenerateToken(int byteLength = 32)
18
{
19
- var randomNumber = new byte[byteLength];
20
- using var rng = RandomNumberGenerator.Create();
21
- rng.GetBytes(randomNumber);
+ Span<byte> randomNumber = stackalloc byte[byteLength];
+ RandomNumberGenerator.Fill(randomNumber);
22
return Convert.ToBase64String(randomNumber);
23
}
24
0 commit comments