Microsoft.Scripting.Utils.MathUtils.AppendRadix C# (CSharp) Method

AppendRadix() private static method

private static AppendRadix ( uint rem, uint radix, char tmp, StringBuilder buf, bool leadingZeros, bool lowerCase ) : void
rem uint
radix uint
tmp char
buf StringBuilder
leadingZeros bool
lowerCase bool
return void
        private static void AppendRadix(uint rem, uint radix, char[] tmp, StringBuilder buf, bool leadingZeros, bool lowerCase) {
            string symbols = lowerCase ? "0123456789abcdefghijklmnopqrstuvwxyz" : "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";

            int digits = tmp.Length;
            int i = digits;
            while (i > 0 && (leadingZeros || rem != 0)) {
                uint digit = rem % radix;
                rem /= radix;
                tmp[--i] = symbols[(int)digit];
            }
            if (leadingZeros) buf.Append(tmp);
            else buf.Append(tmp, i, digits - i);
        }