Encrypt   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 7
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 1
eloc 3
c 1
b 1
f 0
dl 0
loc 7
rs 10

1 Method

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