Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generate() ends up in endless loop with (lowercase => [], uppercase => [], length => $length) #3

Closed
jseplae opened this issue Aug 4, 2014 · 2 comments

Comments

@jseplae
Copy link

jseplae commented Aug 4, 2014

Greetings,

I need to be able to generate only numeric passwords due to some silly requirements, but calling generate() after constructing the object like:

my pass = App::Genpass->new(lowercase => [], uppercase => [], length => $length);
return $pass->generate();

seems to cause a loop condition. According to short debugger runs, the generate() code hangs here:

verify $char_type

while ( ! any { $_ eq $char } @{ $self->$char_type } ) {
$char = $chars[ int rand @chars];
}

Am I approaching the numeric password generation right?

Edit: verify => 0 seems to be a workaround

@xsawyerx
Copy link
Owner

xsawyerx commented Aug 4, 2014

I'll fix that asap. Thanks for reporting!

@xsawyerx
Copy link
Owner

xsawyerx commented Aug 4, 2014

Fixed in 2.34, just released.

Thank you. :)

@xsawyerx xsawyerx closed this as completed Aug 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants