Esempio n. 1
0
        public static unsafe bool TryParseBase62(char *chars, int numChars, out Uuid64 result)
        {
            if (numChars == 0)
            {
                result = default(Uuid64);
                return(true);
            }

            if (numChars <= 11 && Base62.TryDecode(chars, numChars, out ulong x))
            {
                result = new Uuid64(x);
                return(true);
            }

            result = default(Uuid64);
            return(false);
        }
Esempio n. 2
0
        public static bool TryParseBase62(ReadOnlySpan <char> s, out Uuid64 result)
        {
            if (s.Length == 0)
            {
                result = default(Uuid64);
                return(true);
            }

            if (s.Length <= 11 && Base62.TryDecode(s, out ulong x))
            {
                result = new Uuid64(x);
                return(true);
            }

            result = default(Uuid64);
            return(false);
        }