From b51bb9f89e98375171c9bf7061d994f424281ecd Mon Sep 17 00:00:00 2001 From: Thomas von Dein Date: Wed, 4 Oct 2017 11:44:03 +0200 Subject: [PATCH] address issue#10: in Crypt::Random mode, use integer output directly, use correct size --- lib/Crypt/PWSafe3.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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); }; } }