diff --git a/Nerfed.Runtime/Util/RandomId.cs b/Nerfed.Runtime/Util/RandomId.cs new file mode 100644 index 0000000..7ef0a2b --- /dev/null +++ b/Nerfed.Runtime/Util/RandomId.cs @@ -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); + } +} \ No newline at end of file