Total Complexity | 3 |
Total Lines | 24 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
11 | class Hash{ |
||
12 | /** |
||
13 | * Receives a string password and hashes it. |
||
14 | * |
||
15 | * @param string $password |
||
16 | * @return string $hash |
||
17 | */ |
||
18 | public static function hash($password){ |
||
19 | // return (string)password_hash($password, PASSWORD_DEFAULT); |
||
20 | return sha1(md5($password)); |
||
21 | } |
||
22 | |||
23 | /** |
||
24 | * Verifies if an hash corresponds to the given password |
||
25 | * |
||
26 | * @param string $password |
||
27 | * @param string $hash |
||
28 | * @return boolean If the hash was generated from the password |
||
29 | */ |
||
30 | public static function checkHash($string, $hash){ |
||
35 | } |
||
36 | |||
37 | } |