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.
2 parents 7f87b21 + 451bfd4 commit 2cafd97Copy full SHA for 2cafd97
src/KSFramework/Utilities/SecurityHelper.cs
@@ -15,9 +15,8 @@ public static string GetSha256Hash(string input)
15
16
public static string GenerateToken(int byteLength = 32)
17
{
18
- var randomNumber = new byte[byteLength];
19
- using var rng = RandomNumberGenerator.Create();
20
- rng.GetBytes(randomNumber);
+ Span<byte> randomNumber = stackalloc byte[byteLength];
+ RandomNumberGenerator.Fill(randomNumber);
21
return Convert.ToBase64String(randomNumber);
22
}
23
0 commit comments