Subject: | random_string_from() cant get it to work |
Date: | Mon, 25 Apr 2016 19:10:13 +0300 |
To: | bug-bytes-random-secure [...] rt.cpan.org |
From: | Ville Ahtola <puma [...] luotisade.net> |
So I did some tests and was able to reliably reproduce two kinds of errors
with the random_string_from() using two small scripts.
Show quoted text
--- START PERL SCRIPT ---
use Bytes::Random::Secure;
my $random = Bytes::Random::Secure->new( NonBlocking => 1 );
my $passwd = $random->random_string_from( 'abcde', 3 );
--- END PERL SCRIPT ---
This first example gives error message of "Byte count must be a positive
integer." and a return code of 9.
--- START PERL SCRIPT ---
use Bytes::Random::Secure;
my $random = Bytes::Random::Secure->new( NonBlocking => 1 );
my $passwd = $random->random_string_from( 3, 'abcde' );
--- END PERL SCRIPT ---
This tries to read from a blocking entropy pool, stalls, and hangs for so
long that I couldn't be bothered to find out what it eventually outputs.
I'd be curious if you can reproduce this behaviour, or is the problem with
my system or the debian package.