public static string GetRandomAltString(int length, int seed) { var s = ""; var rand = new System.Random(seed); for (var i = 0; i < length; i++) { if (MiscMaths.IsOdd(i)) { s += NUMERIC[rand.Next(NUMERIC.Length)]; } else { s += ALPHA[rand.Next(ALPHA.Length)]; } } return(s); }
public static string GetRandomString(string characters, int length, int seed) { var s = ""; var rand = new System.Random(seed); for (var i = 0; i < length; i++) { if (MiscMaths.IsOdd(i)) { s += characters[rand.Next(characters.Length)]; } else { s += characters[rand.Next(characters.Length)]; } } return(s); }