mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-05 18:48:41 +00:00
14 lines
415 B
C#
14 lines
415 B
C#
namespace SharpbinV3
|
|
{
|
|
public class Utilities
|
|
{
|
|
public static string GenerateRandomString(int length)
|
|
{
|
|
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
var random = new Random();
|
|
return new string(Enumerable.Repeat(chars, length)
|
|
.Select(s => s[random.Next(s.Length)]).ToArray());
|
|
}
|
|
}
|
|
}
|