update: support md5 with sha256

This commit is contained in:
tokumeikoi
2021-09-14 13:10:29 +09:00
parent ec00fc4496
commit 0374a03892
5 changed files with 8 additions and 3 deletions

View File

@ -64,12 +64,12 @@ class Helper
return $str;
}
public static function multiPasswordVerify($algo, $password, $hash)
public static function multiPasswordVerify($algo, $salt, $password, $hash)
{
switch($algo) {
case 'md5': return md5($password) === $hash;
case 'sha256': return hash('sha256', $password) === $hash;
case 'mws': return md5(hash('sha256', $password)) === $hash;
case 'mws': return md5($password . $salt) === $hash;
default: return password_verify($password, $hash);
}
}