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;
}