System.Security.Cryptography.DerEncoder.ParseOidRid C# (CSharp) Method

ParseOidRid() private static method

private static ParseOidRid ( string oidValue, int &startIndex ) : System.Numerics.BigInteger
oidValue string
startIndex int
return System.Numerics.BigInteger
        private static BigInteger ParseOidRid(string oidValue, ref int startIndex)
        {
            Debug.Assert(startIndex < oidValue.Length);

            int endIndex = oidValue.IndexOf('.', startIndex);
            
            if (endIndex == -1)
            {
                endIndex = oidValue.Length;
            }

            Debug.Assert(endIndex > startIndex);

            // The following code is equivalent to
            // BigInteger.TryParse(temp, NumberStyles.None, CultureInfo.InvariantCulture, out value)
            // but doesn't require creating the intermediate substring (TryParse doesn't take start+end/length values)

            BigInteger value = BigInteger.Zero;

            for (int position = startIndex; position < endIndex; position++)
            {
                value *= 10;
                value += AtoI(oidValue[position]);
            }

            startIndex = endIndex + 1;
            return value;
        }