Completed
Pull Request — master (#70)
by
unknown
02:53
created

Utility   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createChallenge() 0 6 1
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