Add basic randomizer
This commit is contained in:
19
ALttPRandomizer/IdGenerator.cs
Normal file
19
ALttPRandomizer/IdGenerator.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace ALttPRandomizer {
|
||||
using System;
|
||||
|
||||
public class IdGenerator {
|
||||
private const string chars = "abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789";
|
||||
private const int length = 10;
|
||||
private static Random random = new Random();
|
||||
|
||||
public string GenerateId() {
|
||||
var str = new char[length];
|
||||
|
||||
for (int i = 0; i < length; i++) {
|
||||
str[i] = chars[random.Next(chars.Length)];
|
||||
}
|
||||
|
||||
return new string(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user