| Conditions | 1 |
| Paths | 1 |
| Total Lines | 8 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | 48 | public function __construct(string $salt, string $username, string $password = '') |
|
| 25 | { |
||
| 26 | 48 | $hash1 = \sha1($password, true); |
|
| 27 | 48 | $hash2 = \sha1($hash1, true); |
|
| 28 | |||
| 29 | 48 | $this->body = [ |
|
| 30 | 48 | Keys::TUPLE => ['chap-sha1', $hash1 ^ \sha1($salt.$hash2, true)], |
|
| 31 | 48 | Keys::USER_NAME => $username, |
|
| 32 | 48 | ]; |
|
| 45 |