| 1 | <?php |
||
| 10 | class Crypt |
||
| 11 | { |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Generate a hashed password string |
||
| 15 | * |
||
| 16 | * @param string $password |
||
| 17 | * |
||
| 18 | * @return bool|string |
||
| 19 | * |
||
| 20 | * @throws \Exception |
||
| 21 | */ |
||
| 22 | public static function hashPassword(string $password) :string |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Verify a password |
||
| 29 | * |
||
| 30 | * @param string $password |
||
| 31 | * @param string $hash |
||
| 32 | * |
||
| 33 | * @return bool |
||
| 34 | */ |
||
| 35 | public static function verifyPassword(string $password, string $hash) :bool |
||
| 39 | |||
| 40 | } |