IDGenerator::newSpanID()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 1
c 1
b 0
f 1
dl 0
loc 3
rs 10
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * Identify generator
4
 * User: moyo
5
 * Date: 24/11/2017
6
 * Time: 2:22 PM
7
 */
8
9
namespace Carno\Tracing\Chips;
10
11
trait IDGenerator
12
{
13
    /**
14
     * @return string
15
     */
16
    protected function newTraceID() : string
17
    {
18
        return bin2hex(random_bytes(defined('TRACING_ID_128BIT') ? 16 : 8));
19
    }
20
21
    /**
22
     * @return string
23
     */
24
    protected function newSpanID() : string
25
    {
26
        return bin2hex(random_bytes(8));
27
    }
28
}
29