Nerfed/Nerfed.Runtime/Util/RandomId.cs

13 lines
296 B
C#
Raw Normal View History

2024-11-16 14:54:34 +01:00
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);
}
}