Added hex (H) to the RandomString function.

This commit is contained in:
ruri
2019-04-23 13:48:42 +02:00
parent ad8b3c6b94
commit 177272351e
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -592,6 +592,7 @@ namespace RuriLib
var uppercase = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var digits = "0123456789";
var symbols = "\\!\"£$%&/()=?^'{}[]@#,;.:-_*+";
var hex = digits + "abcdef";
var allchars = lowercase + uppercase + digits + symbols;
outputString = new string(localInputString
.ToCharArray()
@@ -599,6 +600,7 @@ namespace RuriLib
.Select(c => c == 'U' ? uppercase[data.rand.Next(0, uppercase.Length)] : c)
.Select(c => c == 'D' ? digits[data.rand.Next(0, digits.Length)] : c)
.Select(c => c == 'S' ? symbols[data.rand.Next(0, symbols.Length)] : c)
.Select(c => c == 'H' ? hex[data.rand.Next(0, hex.Length)] : c)
.Select(c => c == 'A' ? allchars[data.rand.Next(0, allchars.Length)] : c)
.ToArray());
break;