Completed
Pull Request — master (#70)
by
unknown
01:32
created

Utility::createChallenge()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace u2flib_server;
6
7
/**
8
 * Class Utility
9
 *
10
 * @package u2flib_server
11
 */
12
class Utility
13
{
14
    /**
15
     * @return string
16
     *
17
     * @throws \Exception
18
     */
19
    public static function createChallenge(): string
20
    {
21
        $challenge = random_bytes(32);
22
23
        return Convert::base64uEncode($challenge);
24
    }
25
}
26