jSignature.Tools.Base30Converter.ToBase30 C# (CSharp) Метод

ToBase30() приватный Метод

private ToBase30 ( int val ) : List
val int
Результат List
        private List<int> ToBase30(int val)
        {
            List<int> retVal = new List<int>();

            //Determine the max power of bitness
            int pow = 0;
            while (Math.Pow(bitness, pow + 1) < val) pow++;

            //Iterate through each of the powers of the bitness to
            int num = val;
            while (pow >= 0)
            {

                int mag = Convert.ToInt32(Math.Pow(bitness,  pow));
                int div = num / mag;
                retVal.Add(div);
                num = num - (div * mag);
                pow--;
            }

            return retVal;
        }