update changepassword

This commit is contained in:
Tokumeikoi
2020-02-02 20:44:52 +08:00
parent a8db24492b
commit 32d6a983a3
3 changed files with 15 additions and 12 deletions

View File

@ -75,4 +75,13 @@ class Helper
}
return "vmess://" . base64_encode(json_encode($config)) . "\r\n";
}
public static function multiPasswordVerify($algo, $password, $hash)
{
switch($algo) {
case 'md5': return md5($password) === $hash;
case 'sha256': return hash('sha256', $password) === $hash;
default: return password_verify($password, $hash);
}
}
}