return root string
@param  mixed  $data
@return string
177321
static public function root($data=null)
    {
        if (!$data) {
            $data = static::encodeElement([], 'xml');
        } elseif (is_array($data)) {
            $data = static::encodeElement($data, null);
        } elseif (strpos($data, '<') === false) {
            $data = static::encodeElement("<$data></$data>", null);
        }
        $node = simplexml_load_string($data);
        return $node->asXML();
    }
558983
protected final function getWhere($data) {
        $con = [];
        foreach ($this->primaryKeys as $f) {
            if (array_key_exists($f, $data)) {
                if (isset($data[ $f ])) {
                    $con [ $f ] = $data [ $f ];
                } else {
                    $con [ $f . ' $' ] = null;
                }
            }
        }

        return $con;
    }
330207
protected function deserializeDataRecursive($data)
	{
		foreach ($data as $key => $value) {
			if (is_string($value) && trim($value)) {
				if (is_object($data)) {
					$data->$key = \StringUtil::deserialize($value);
				}
				else {
					$data[$key] = \StringUtil::deserialize($value);
				}
			}
			else if (is_array($value) || is_object($value)) {
				if (is_object($data)) {
					$data->$key = $this->deserializeDataRecursive($value);
				}
				else {
					$data[$key] = $this->deserializeDataRecursive($value);
				}
			}
		}

		return $data;
	}
1181187
public function decode($data)
    {
        $data = (string) $data;
        // skip empty strings (that cause "Syntax error"?)
        if ($data === '') {
            return null;
        }

        $data = json_decode($data, $this->options['assoc'], $this->options['depth'],
            $this->options['flags']);
        if (json_last_error() > 0) {
            $data = null;
            $this->error = json_last_error_msg() ?: 'Unknown';
        }

        return $data;
    }
833514
public function unConvert($data)
    {
        if (empty($data) || !is_string($data) || ($out = @unserialize($data)) === false)
            return null;

        if (!is_array($out) || empty($out))
            return null;

        return $out;
    }
1362804
public function getString($String)
    {
        if (isset($this->Data[$String])) {
            return $this->Data[$String];
        }
        return isset($this->Fallback[$String]) ? $this->Fallback[$String] : '';
    }
250067
public function decode($data)
    {
        $decoded    = '';
        $delimiters = "\n";
        $token      = strtok($data, $delimiters);

        while (false !== $token) {
            $decoded .= base64_decode($token);

            $token = strtok($delimiters);
        }

        return $decoded;
    }
416747
private function getstring($data = "")
    {
        $char = fread($this->fp, 1);
        while (ord($char) > 0) {        // 字符串按照C格式保存，以\0结束
            $data .= $char;             // 将读取的字符连接到给定字符串之后
            $char = fread($this->fp, 1);
        }
        
        return $data;
    }
1240560
public function encode($data) : string
    {
        $result = json_encode($data, $this->options, $this->maxDepth);

        $this->checkLastError();

        return $result;
    }
51300
protected function COinSStringForObject($data)
    {
        $infoList = [];
        foreach ($data as $key => $info) {
            if ($info) {
                foreach ($info as $infoItem) {
                    $infoList[] = $key . '=' . rawurlencode($infoItem[0]['values'][0]);
                }
            }
        }
        return implode('&', $infoList);
    }
171281
static public function encodeElement($data, $root='xml')
    {
        if (!$data) {
            $data = [];
        } elseif (is_string($data)) {
            return $data;
        }
        
        assert('is_array($data) || $data instanceof Traversable');
        
        $output = '';
        if ($data) foreach ($data as $key => $val) {
            if (is_numeric($key)) {
                // Convert the key to a valid string
                $key = "unknownNode_". (string) $key;
            }
            
            // Delete any char not allowed in XML element names
            $key = preg_replace('/[^a-z0-9\-\_\.\:]/i', '', $key);
            
            if (is_array($val)) {
                $output .= '<' . $key . '>';
                $output .= self::encodeElement($val, null);
                $output .= '</' . $key . '>';
            } else {
                
                if (is_numeric($val)){
                    $output .= "<".$key.">".$val."</".$key.">";
                }else{
                    $val = str_replace('&', '&amp;', print_r($val, true));
                    $output .= "<". $key . "><![CDATA[".$val."]]></" . $key . ">";
                }
            }
        }
        if ($output) {
            $output = PHP_EOL . $output . PHP_EOL;
        }
        if ($root) {
            $output = "<?xml version='1.0' encoding='utf-8'?>" . PHP_EOL . "<$root>$output</$root>";
        }
        
        return $output;
    }
1371219
public static function decrypt($data) : string {
      $crypter = new Crypter();

      return $crypter->decrypt($data, self::getAppKey());
    }
15743
public function decode(string $data): string
    {
        $this->validateInput($data);

        $data = str_split($data);
        $data = array_map(function ($character) {
            return strpos($this->options["characters"], $character);
        }, $data);

        $leadingZeroes = 0;
        while (!empty($data) && 0 === $data[0]) {
            $leadingZeroes++;
            array_shift($data);
        }

        $converted = $this->baseConvert($data, 58, 256);

        if (0 < $leadingZeroes) {
            $converted = array_merge(
                array_fill(0, $leadingZeroes, 0),
                $converted
            );
        }

        $decoded = implode("", array_map("chr", $converted));
        if (true === $this->options["check"]) {
            $hash = substr($decoded, 0, -(Base58::CHECKSUM_SIZE));
            $hash = hash("sha256", $hash, true);
            $hash = hash("sha256", $hash, true);
            $checksum = substr($hash, 0, Base58::CHECKSUM_SIZE);

            if (0 !== substr_compare($decoded, $checksum, -(Base58::CHECKSUM_SIZE))) {
                $message = sprintf(
                    'Checksum "%s" does not match the expected "%s"',
                    bin2hex(substr($decoded, -(Base58::CHECKSUM_SIZE))),
                    bin2hex($checksum)
                );
                throw new RuntimeException($message);
            }

            $version = substr($decoded, 0, Base58::VERSION_SIZE);
            $version = ord($version);

            if ($version !==  $this->options["version"]) {
                $message = sprintf(
                    'Version "%s" does not match the expected "%s"',
                    $version,
                    $this->options["version"]
                );
                throw new RuntimeException($message);
            }

            $decoded = substr($decoded, Base58::VERSION_SIZE, -(Base58::CHECKSUM_SIZE));
        }
        return $decoded;
    }
813594
private function encodeString($data = null)
    {
        $data = is_null($data) ? $this->data : $data;
        return sprintf("%d:%s", strlen($data), $data);
    }
1108675
private function getOnePathData($data, string $root, bool $allowFiles, bool $allowDirs): ?string
    {
        if ($data === null) {
            return null;
        }

        if (!\is_array($data)) {
            $data = [$data];
        }

        $result = $this->existingPaths($data, $root, $allowFiles, $allowDirs);

        if ($result === null || \count($result) !== 1) {
            return null;
        }

        return reset($result);
    }
428364
private function getPathsData($data, string $root): ?array
    {
        if ($data === null || !\is_array($data) || \count($data) === 0) {
            return null;
        }

        return $this->existingPaths($data, $root);
    }
605309
private function normalizeData($data)
    {
        $normalizedData = [];

        foreach ($data as $key => $value) {
            if ('#text' === $key) {
                $key = 'direction';
            }

            $normalizedData[trim($key, '_')] = $value;
        }

        return $normalizedData;
    }