mirror of
https://codeberg.org/scip/Crypt--PWSafe3.git
synced 2025-12-17 20:51:00 +01:00
address issue#10: in Crypt::Random mode, use integer output directly, use correct size
This commit is contained in:
@@ -58,9 +58,8 @@ BEGIN {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
*Crypt::PWSafe3::random = sub {
|
*Crypt::PWSafe3::random = sub {
|
||||||
my($this, $len) = @_;
|
my($this, $len) = @_;
|
||||||
my $bits = makerandom(Size => 256, Strength => 1);
|
return makerandom(Size => $len * 8, Strength => 1, Uniform => 1);
|
||||||
return substr($bits, 0, $len);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user