| Conditions | 1 |
| Paths | 1 |
| Total Lines | 20 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | 14 | private function generateV4Uuid(): string |
|
| 25 | { |
||
| 26 | 14 | return sprintf( |
|
| 27 | 14 | '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', |
|
| 28 | // 32 bits for "time_low" |
||
| 29 | 14 | random_int(0, 0xffff), |
|
| 30 | 14 | random_int(0, 0xffff), |
|
| 31 | // 16 bits for "time_mid" |
||
| 32 | 14 | random_int(0, 0xffff), |
|
| 33 | // 16 bits for "time_hi_and_version", |
||
| 34 | // four most significant bits holds version number 4 |
||
| 35 | 14 | random_int(0, 0x0fff) | 0x4000, |
|
| 36 | // 16 bits, 8 bits for "clk_seq_hi_res", |
||
| 37 | // 8 bits for "clk_seq_low", |
||
| 38 | // two most significant bits holds zero and one for variant DCE1.1 |
||
| 39 | 14 | random_int(0, 0x3fff) | 0x8000, |
|
| 40 | // 48 bits for "node" |
||
| 41 | 14 | random_int(0, 0xffff), |
|
| 42 | 14 | random_int(0, 0xffff), |
|
| 43 | 14 | random_int(0, 0xffff) |
|
| 44 | ); |
||
| 47 |