ringfinger/backend/classes/core/Password.php

16 lines
288 B
PHP
Raw Permalink Normal View History

2020-08-17 23:46:58 +02:00
<?php
declare(strict_types=1);
class Password
{
2020-08-23 12:37:39 +02:00
public static function IsValid(string $password, string $hash): bool
{
return password_verify($password, $hash);
}
2020-08-17 23:46:58 +02:00
2020-08-23 12:37:39 +02:00
public static function GetHash(string $password): string
2020-08-17 23:46:58 +02:00
{
return password_hash($password, PASSWORD_BCRYPT);
}
}