mirror of
https://github.com/EpinelPS/EpinelPS.git
synced 2025-12-16 08:54:47 +01:00
20 lines
511 B
C#
20 lines
511 B
C#
namespace nksrv.Utils
|
|
{
|
|
public class Rng
|
|
{
|
|
private static Random random = new Random();
|
|
|
|
public static string RandomString(int length)
|
|
{
|
|
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
return new string(Enumerable.Repeat(chars, length)
|
|
.Select(s => s[random.Next(s.Length)]).ToArray());
|
|
}
|
|
|
|
public static int RandomId()
|
|
{
|
|
return random.Next();
|
|
}
|
|
}
|
|
}
|