1 | <?php |
||
5 | class Hash |
||
6 | { |
||
7 | /** |
||
8 | * Application Object |
||
9 | * |
||
10 | * @var \System\Application |
||
11 | */ |
||
12 | private $app; |
||
13 | |||
14 | /** |
||
15 | * Constructor |
||
16 | * |
||
17 | * @param \System\Application $app |
||
18 | */ |
||
19 | public function __construct(Application $app) |
||
23 | |||
24 | /** |
||
25 | * Hash password |
||
26 | * |
||
27 | * @param $password |
||
28 | * @return string |
||
29 | */ |
||
30 | public function password(string $password) |
||
45 | |||
46 | /** |
||
47 | * Check if the given password is verified with the given hash |
||
48 | * |
||
49 | * @param $password1 |
||
50 | * @param $password2 |
||
51 | * @return bool |
||
52 | */ |
||
53 | public function passwordCheck(string $password1, string $password2) |
||
57 | |||
58 | /** |
||
59 | * Hash the given string |
||
60 | * |
||
61 | * @param $string |
||
62 | * @return string |
||
63 | */ |
||
64 | public function hash(string $string) |
||
68 | |||
69 | /** |
||
70 | * Check if the given hashes are equal |
||
71 | * |
||
72 | * @param $hash1 |
||
73 | * @param $hash2 |
||
74 | * @return bool |
||
75 | */ |
||
76 | public function hashCheck(string $hash1, string $hash2) |
||
80 | } |
||
81 |