StringExtensions.RandomAscii Method

Namespace:
Weavy.Core.Helpers
Assembly:
Weavy.Core.dll

RandomAscii(int, int, int, int, int, bool)

Generates a random ascii string.

public static string RandomAscii(int length, int digits = 0, int lowers = 0, int uppers = 0, int specials = 0, bool ambiguous = false)

Parameters

length
int

The total length of the generated string.

digits
int

The minimum number of digits in the generated string

lowers
int

The minimum number of lower case letters in the generated string.

uppers
int

The minimum number of upper case letters in the generated string

specials
int

The exact number of special characters in the generated string.

ambiguous
bool

true to allow ambiguous chars, e.g. l and I, 0 and O etc, otherwise false.

Returns

string

A random string.