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 249b565 commit 5001569Copy full SHA for 5001569
src/SignalR/common/Http.Connections/src/Internal/HttpConnectionManager.cs
@@ -105,11 +105,10 @@ public void RemoveConnection(string id)
105
106
private static string MakeNewConnectionId()
107
{
108
- // TODO: Use Span when WebEncoders implements Span methods https://github.com/aspnet/Home/issues/2966
109
// 128 bit buffer / 8 bits per byte = 16 bytes
110
- var buffer = new byte[16];
111
- _keyGenerator.GetBytes(buffer);
+ Span<byte> buffer = stackalloc byte[16];
112
// Generate the id with RNGCrypto because we want a cryptographically random id, which GUID is not
+ _keyGenerator.GetBytes(buffer);
113
return WebEncoders.Base64UrlEncode(buffer);
114
}
115
0 commit comments