public static bool TryParseInt(osUTF8 t, out int res)
        {
            res = 0;

            t.SelfTrim();
            int len = t.m_len;

            if (len == 0)
            {
                return(false);
            }

            byte[] data = t.m_data;

            int start = t.m_offset;

            len += start;

            bool neg = false;

            if (data[start] == (byte)'-')
            {
                neg = true;
                ++start;
            }
            else if (data[start] == (byte)'+')
            {
                ++start;
            }

            int b;

            try
            {
                while (start < len)
                {
                    b  = data[start];
                    b -= (byte)'0';
                    if (b < 0 || b > 9)
                    {
                        break;
                    }

                    res *= 10;
                    res += b;
                    ++start;
                }
                if (neg)
                {
                    res = -res;
                }
                return(true);
            }
            catch { }
            return(false);
        }
        public static bool TryParseUUID(osUTF8 inp, out UUID res, bool dashs = true)
        {
            res = UUID.Zero;
            osUTF8 t = new osUTF8(inp);

            t.SelfTrim();
            int len = t.m_len;

            if (len == 0)
            {
                return(false);
            }

            if (dashs)
            {
                if (len < 36)
                {
                    return(false);
                }
            }
            else
            {
                if (len < 32)
                {
                    return(false);
                }
            }

            byte[] data       = t.m_data;
            int    dataoffset = t.m_offset;

            int _a = 0;

            if (!Utils.TryHexToInt(data, dataoffset, 8, out _a))
            {
                return(false);
            }
            dataoffset += 8;

            if (dashs)
            {
                if (data[dataoffset] != (byte)'-')
                {
                    return(false);
                }
                ++dataoffset;
            }

            int n;

            if (!Utils.TryHexToInt(data, dataoffset, 4, out n))
            {
                return(false);
            }
            short _b = (short)n;

            dataoffset += 4;

            if (dashs)
            {
                if (data[dataoffset] != (byte)'-')
                {
                    return(false);
                }
                ++dataoffset;
            }

            if (!Utils.TryHexToInt(data, dataoffset, 4, out n))
            {
                return(false);
            }
            short _c = (short)n;

            dataoffset += 4;

            if (dashs)
            {
                if (data[dataoffset] != (byte)'-')
                {
                    return(false);
                }
                ++dataoffset;
            }

            if (!Utils.TryHexToInt(data, dataoffset, 4, out n))
            {
                return(false);
            }

            byte _d = (byte)(n >> 8);
            byte _e = (byte)n;

            dataoffset += 4;

            if (dashs)
            {
                if (data[dataoffset] != (byte)'-')
                {
                    return(false);
                }
                ++dataoffset;
            }

            if (!Utils.TryHexToInt(data, dataoffset, 8, out n))
                return(false); }