| Conditions | 2 |
| Paths | 1 |
| Total Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function password(string $password) |
||
| 31 | { |
||
| 32 | $timeTarget = 0.05; |
||
| 33 | $cost = 8; |
||
| 34 | $password; |
||
| 35 | |||
| 36 | do { |
||
| 37 | $cost++; |
||
| 38 | $start = microtime(true); |
||
| 39 | $password = password_hash("test", PASSWORD_BCRYPT, ["cost" => $cost]); |
||
| 40 | $end = microtime(true); |
||
| 41 | } while (($end - $start) < $timeTarget); |
||
| 42 | |||
| 43 | return $password; |
||
| 44 | } |
||
| 45 | |||
| 81 |