1: | <?php |
2: | |
3: | declare(strict_types=1); |
4: | |
5: | /** |
6: | * This file is part of the Nexus framework. |
7: | * |
8: | * (c) John Paul E. Balandan, CPA <paulbalandan@gmail.com> |
9: | * |
10: | * For the full copyright and license information, please view |
11: | * the LICENSE file that was distributed with this source code. |
12: | */ |
13: | |
14: | namespace Nexus\Password; |
15: | |
16: | /** |
17: | * Interface for hashers needing to pass a salt. |
18: | */ |
19: | interface SaltedHashInterface extends HashInterface |
20: | { |
21: | /** |
22: | * @param array{ |
23: | * cost?: int, |
24: | * iterations?: int, |
25: | * length?: int, |
26: | * opslimit?: int, |
27: | * memlimit?: int, |
28: | * memory_cost?: int, |
29: | * threads?: int, |
30: | * time_cost?: int, |
31: | * } $options |
32: | * |
33: | * @throws HashException |
34: | */ |
35: | public function hash(#[\SensitiveParameter] string $password, array $options = [], string $salt = ''): string; |
36: | |
37: | public function verify(#[\SensitiveParameter] string $password, string $hash, string $salt = ''): bool; |
38: | } |
39: |