sochkeal/Satori/RNG.cs

33 lines
758 B
C#
Raw Permalink Normal View History

2023-06-28 20:12:23 +00:00
using System;
namespace SockChatKeepAlive {
public static class RNG {
private static readonly Random random = new();
public static int Next() {
lock(random)
return random.Next();
}
public static int Next(int max) {
lock(random)
return random.Next(max);
}
public static int Next(int min, int max) {
lock(random)
return random.Next(min, max);
}
public static void NextBytes(byte[] buffer) {
lock(random)
random.NextBytes(buffer);
}
public static double NextDouble() {
lock(random)
return random.NextDouble();
}
}
}