fix for 32bit systems (179)
This commit is contained in:
parent
ed969dec2d
commit
db9a2ba2a1
|
@ -203,7 +203,7 @@ function generateSalt($len) {
|
||||||
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890./';
|
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890./';
|
||||||
$salt = '';
|
$salt = '';
|
||||||
for ($i = 0; $i < $len; $i++) {
|
for ($i = 0; $i < $len; $i++) {
|
||||||
$pos= getRandomNumber() % strlen($chars);
|
$pos = abs(getRandomNumber() % strlen($chars));
|
||||||
$salt .= $chars{$pos};
|
$salt .= $chars{$pos};
|
||||||
}
|
}
|
||||||
return $salt;
|
return $salt;
|
||||||
|
@ -311,7 +311,7 @@ function generateRandomPassword() {
|
||||||
for ($x = 0; $x < 10000; $x++) {
|
for ($x = 0; $x < 10000; $x++) {
|
||||||
$password = '';
|
$password = '';
|
||||||
for ($i = 0; $i < $length; $i++) {
|
for ($i = 0; $i < $length; $i++) {
|
||||||
$rand = getRandomNumber() % 65;
|
$rand = abs(getRandomNumber() % 65);
|
||||||
$password .= $list[$rand];
|
$password .= $list[$rand];
|
||||||
}
|
}
|
||||||
if (checkPasswordStrength($password, null, null) === true) {
|
if (checkPasswordStrength($password, null, null) === true) {
|
||||||
|
|
Loading…
Reference in New Issue