fix for 32bit systems (179)

This commit is contained in:
Roland Gruber 2016-04-19 20:41:51 +02:00
parent ed969dec2d
commit db9a2ba2a1
1 changed files with 2 additions and 2 deletions

View File

@ -203,7 +203,7 @@ function generateSalt($len) {
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890./';
$salt = '';
for ($i = 0; $i < $len; $i++) {
$pos= getRandomNumber() % strlen($chars);
$pos = abs(getRandomNumber() % strlen($chars));
$salt .= $chars{$pos};
}
return $salt;
@ -311,7 +311,7 @@ function generateRandomPassword() {
for ($x = 0; $x < 10000; $x++) {
$password = '';
for ($i = 0; $i < $length; $i++) {
$rand = getRandomNumber() % 65;
$rand = abs(getRandomNumber() % 65);
$password .= $list[$rand];
}
if (checkPasswordStrength($password, null, null) === true) {