Random uint util
This commit is contained in:
parent
d80e1177b9
commit
5eaf3547dc
13
Nerfed.Runtime/Util/RandomId.cs
Normal file
13
Nerfed.Runtime/Util/RandomId.cs
Normal file
@ -0,0 +1,13 @@
|
||||
using System.Security.Cryptography;
|
||||
|
||||
namespace Nerfed.Runtime.Util;
|
||||
|
||||
public static class RandomId
|
||||
{
|
||||
public static uint GenerateSecureRandomUInt()
|
||||
{
|
||||
byte[] buffer = new byte[4];
|
||||
RandomNumberGenerator.Fill(buffer);
|
||||
return BitConverter.ToUInt32(buffer, 0);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user