Skip to content

Commit

Permalink
Merge pull request #1 from driehle/feat/php8.2
Browse files Browse the repository at this point in the history
Allow PHP 8.2 and drop PHP 7.3
  • Loading branch information
driehle authored Dec 29, 2022
2 parents 78b46f0 + f5fe10b commit fd9faaa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
}
],
"require": {
"php": "^7.3 || ~8.0.0 || ~8.1.0"
"php": ">=7.4 <8.3"
},
"require-dev": {
"ergebnis/composer-normalize": "^2.18.0",
Expand All @@ -42,5 +42,10 @@
"cs-check": "php-cs-fixer fix --dry-run --verbose",
"cs-fix": "php-cs-fixer fix --verbose",
"test": "phpunit"
},
"config": {
"allow-plugins": {
"ergebnis/composer-normalize": true
}
}
}
16 changes: 8 additions & 8 deletions library/Md5Crypt/Md5Crypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ protected static function to64($v, $n)
$ret = '';

while (--$n >= 0) {
$ret .= $itoa64[$v & 0x3f];
$ret .= $itoa64[$v & 0x3F];
$v = $v >> 6;
}

Expand Down Expand Up @@ -135,20 +135,20 @@ public static function unix($pw, $salt = null, $Magic = '$1$')
$passwd = '';
$passwd .= self::to64((intval(ord($final[0])) << 16)
| (intval(ord($final[6])) << 8)
| (intval(ord($final[12]))), 4);
| intval(ord($final[12])), 4);
$passwd .= self::to64((intval(ord($final[1])) << 16)
| (intval(ord($final[7])) << 8)
| (intval(ord($final[13]))), 4);
| intval(ord($final[13])), 4);
$passwd .= self::to64((intval(ord($final[2])) << 16)
| (intval(ord($final[8])) << 8)
| (intval(ord($final[14]))), 4);
| intval(ord($final[14])), 4);
$passwd .= self::to64((intval(ord($final[3])) << 16)
| (intval(ord($final[9])) << 8)
| (intval(ord($final[15]))), 4);
$passwd .= self::to64((intval(ord($final[4]) << 16)
| intval(ord($final[15])), 4);
$passwd .= self::to64(intval(ord($final[4]) << 16)
| (intval(ord($final[10])) << 8)
| (intval(ord($final[5])))), 4);
$passwd .= self::to64((intval(ord($final[11]))), 2);
| intval(ord($final[5])), 4);
$passwd .= self::to64(intval(ord($final[11])), 2);

// Return the final string
return $Magic . $salt . '$' . $passwd;
Expand Down

0 comments on commit fd9faaa

Please sign in to comment.