Replace obsolete rng call with RandomNumberGenerator.GetBytes

This commit is contained in:
Passive
2022-08-03 16:36:59 +10:00
parent 08c3bbde3c
commit 2f281f366b

View File

@@ -133,9 +133,7 @@ namespace MareSynchronosServer.Hubs
allowableChars = @"ABCDEFGHJKLMNPQRSTUVWXYZ0123456789";
// Generate random data
var rnd = new byte[length];
using (var rng = new RNGCryptoServiceProvider())
rng.GetBytes(rnd);
var rnd = RandomNumberGenerator.GetBytes(length);
// Generate the output string
var allowable = allowableChars.ToCharArray();