diff --git a/lib/Crypt/PWSafe3.pm b/lib/Crypt/PWSafe3.pm index 6a68d01..30524c4 100644 --- a/lib/Crypt/PWSafe3.pm +++ b/lib/Crypt/PWSafe3.pm @@ -58,9 +58,8 @@ BEGIN { } else { *Crypt::PWSafe3::random = sub { - my($this, $len) = @_; - my $bits = makerandom(Size => 256, Strength => 1); - return substr($bits, 0, $len); + my($this, $len) = @_; + return makerandom(Size => $len * 8, Strength => 1, Uniform => 1); }; } }