Random uint util

This commit is contained in:
max 2024-11-16 14:54:34 +01:00
parent d80e1177b9
commit 5eaf3547dc

View 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);
}
}