bigloo.foreign.uelong_to_string C# (CSharp) Method

uelong_to_string() public static method

public static uelong_to_string ( long n, int radix ) : byte[]
n long
radix int
return byte[]
        public static byte[] uelong_to_string( long n, int radix )
        {
            int bits= 0;
            ulong abs_n= (ulong)n;
            ulong abs_n2= abs_n;
            uint uradix = (uint)radix;

            do
            {
               ++bits;
               abs_n2 /= uradix;
            }
            while (0 < abs_n2);

            byte[] result= new byte[bits];

            do
            {
               --bits;
               result[bits]= hexa[abs_n % uradix];
               abs_n /= uradix;
            }
            while (0 < bits);

            return result;
        }
foreign