25 defined(
'XOOPS_ROOT_PATH') or die('Restricted access');
35 if (!is_string($hex))
return null;
38 for ($a = 0; $a < $len; $a += 2) {
39 $r .= chr(hexdec($hex{$a} . $hex{($a + 1)}));
64 $accepted = array(
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
'8',
'9',
'a',
'b',
'c',
'd',
'e',
'f');
66 if ($checklen > $len) {
69 $hex = strtolower($hex);
70 for (
$i = 0;
$i < $len;
$i++) {
71 if (!in_array($hex{
$i}, $accepted)) {
86 switch ($store_method) {
88 return urlencode($data);
90 return base64_encode($data);
92 return convert_uuencode($data);
96 return bin2hex($data);
108 switch ($store_method) {
110 return urldecode($data);
112 return base64_decode($data);
114 return convert_uudecode($data);