Below is some sample code using String::Random to generate random strings of a certain length. It then removes invalid duplicates and appends new random strings until the password passes without duplicates. This assumes you are only working with ascii.
use String::Random; my $length = 15; my $Random = new String::Random; my $password = ''; while (length($password) < $length) { my $missing_length = $length - length($password); my $added_string = $Random->randpattern('.' x $missing_length); $password .= $added_string; $password =~ s/[A-Za-z]{3,}|\d{3,}|[^A-Za-z\d]{3,}//; }
In reply to Re: Removing similar characters
by Kc12349
in thread Removing similar characters
by rspishock
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |