16 lines
306 B
PHP
16 lines
306 B
PHP
|
<?php
|
||
|
|
||
|
declare(strict_types=1);
|
||
|
|
||
|
class Password
|
||
|
{
|
||
|
public static function IsValid(string $password, string $hash): bool
|
||
|
{
|
||
|
return password_verify($password, $hash);
|
||
|
}
|
||
|
|
||
|
public static function GetHash(string $password): string
|
||
|
{
|
||
|
return password_hash($password, PASSWORD_BCRYPT);
|
||
|
}
|
||
|
}
|