Archived Forum Post

Index of archived forum posts

Question:

Request RandomPassword method for including/excluding upper- and/or lower-case characters

Nov 17 '15 at 04:09

I would very much like to see the following overloaded method added to the Chilkat.Prng class:

public string RandomPassword(int length, bool mustIncludeDigit, bool mustIncludeUppercase, bool mustIncludeLowercase, string mustHaveOneOf, string excludeChars);

The reason is obviously that the current method

public string RandomPassword(int length, bool mustIncludeDigit, bool upperAndLowercase, string mustHaveOneOf, string excludeChars)

gives the option to require upper- and lower-case characters in the generated string, but does not have an option limit to only upper- or lower-case characters. If upperAndLowercase is set to false, the generated string may contain both upper- and lower-case characters, but it is not guaranteed to have both.

I want to have an option similar to that of the RandomString() method, where I can specify explicitly to include or exclude each case.