MegaApi.Rsa.nbits C# (CSharp) Method

nbits() public static method

public static nbits ( uint x ) : int
x uint
return int
        public static int nbits(uint x)
        {
            int n = 1;
            uint t;
            if ((t = x >> 16) != 0) { x = t; n += 16; }
            if ((t = x >> 8) != 0) { x = t; n += 8; }
            if ((t = x >> 4) != 0) { x = t; n += 4; }
            if ((t = x >> 2) != 0) { x = t; n += 2; }
            if ((t = x >> 1) != 0) { x = t; n += 1; }
            return n;
        }