public override uint Parse(string value, int startIndex, int endIndex, uint numberBase, IDictionary<char, uint> charToDigits, uint[] digitsRes)
{
uint newLength = base.Parse(value, startIndex, endIndex, numberBase, charToDigits, digitsRes);
// Maybe base method already parsed this number
if (newLength != 0) return newLength;
// Do parsing in big cycle
ulong numberBaseLong = numberBase;
ulong digit;
for (int i = startIndex; i <= endIndex; ++i)
{
digit = StrRepHelper.GetDigit(charToDigits, value[i], numberBase);
// Next multiply existing values by base and add this value to them
if (newLength == 0)
{
if (digit != 0)
{
digitsRes[0] = (uint)digit;
newLength = 1;
}
}
else
{
for (uint j = 0; j < newLength; ++j)
{
digit += digitsRes[j] * numberBaseLong;
digitsRes[j] = (uint)digit;
digit >>= 32;
}
if (digit != 0)
{
digitsRes[newLength++] = (uint)digit;
}
}
}
return newLength;
}