Encrypt::token()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 2
c 1
b 1
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 3
1
<?php
2
3
namespace Mfonte\Base62x\Encryption\Cypher;
4
5
class Encrypt
6
{
7
    public static function token($data, $method, $key)
8
    {
9
        $iv = openssl_random_pseudo_bytes(Bytes::iv($method));
10
11
        return bin2hex($iv).openssl_encrypt($data, $method, $key, 0, $iv);
12
    }
13
}
14