29 lines
588 B
PHP
Executable File
29 lines
588 B
PHP
Executable File
<?php
|
|
|
|
declare(strict_types=1);
|
|
/**
|
|
* This file is part of the youyao/admin-api.
|
|
*
|
|
* (c) youyao <info@nuancebiotech.cn>
|
|
* This source file is subject to the license under the project that is bundled.
|
|
*/
|
|
namespace App\Kernel\Password;
|
|
|
|
class Password
|
|
{
|
|
public function hash(string $password)
|
|
{
|
|
return password_hash($password, PASSWORD_BCRYPT);
|
|
}
|
|
|
|
/**
|
|
* @param string $password
|
|
* @param string $hash
|
|
* @return bool
|
|
*/
|
|
public function verify(string $password, string $hash)
|
|
{
|
|
return password_verify($password, $hash);
|
|
}
|
|
}
|