public static function guid($need_braces = false, $lowercase = false, $existed = null)
    {
        if (!$existed) {
            $existed = static::guid_bin();
        }
        $charid = '';
        for ($i = 0; $i < strlen($existed); $i++) {
            $charid .= bin2hex($existed[$i]);
        }
        $hyphen = chr(45);
        $guid = chr(123)
                .substr($charid, 0, 8) . $hyphen
                .substr($charid, 8, 4) . $hyphen
                .substr($charid, 12, 4) . $hyphen
                .substr($charid, 16, 4) . $hyphen
                .substr($charid, 20, 12) . chr(125);
        if ($need_braces === false)
        {
            $guid = (($need_braces == true) ? $guid : trim($guid, '{}'));
        }
        return ($lowercase === true ? strtolower($guid) : $guid);
    }