Conditions | 3 |
Paths | 3 |
Total Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | public static function hex2bin($data) |
||
22 | { |
||
23 | $len = strlen($data); |
||
24 | |||
25 | if (null === $len) { |
||
26 | return; |
||
27 | } |
||
28 | if ($len % 2) { |
||
29 | trigger_error('hex2bin(): Hexadecimal input string must have an even length', E_USER_WARNING); |
||
30 | |||
31 | return false; |
||
32 | } |
||
33 | |||
34 | return pack('H*', $data); |
||
35 | } |
||
36 | } |
||
37 |