@staticmethod
    def getLengthInBits(mode, type):

        if 1 <= type and type < 10:

            #// 1 - 9

            if mode == QRMode.MODE_NUMBER     : return 10
            if mode == QRMode.MODE_ALPHA_NUM     : return 9
            if mode == QRMode.MODE_8BIT_BYTE    : return 8
            if mode == QRMode.MODE_KANJI      : return 8
            raise Exception("mode:" + mode)

        elif (type < 27):

            #// 10 - 26

            if mode == QRMode.MODE_NUMBER     : return 12
            if mode == QRMode.MODE_ALPHA_NUM     : return 11
            if mode == QRMode.MODE_8BIT_BYTE    : return 16
            if mode == QRMode.MODE_KANJI      : return 10
            raise Exception("mode:" + mode)

        elif (type < 41):

            #// 27 - 40

            if mode == QRMode.MODE_NUMBER     : return 14
            if mode == QRMode.MODE_ALPHA_NUM    : return 13
            if mode == QRMode.MODE_8BIT_BYTE    : return 16
            if mode == QRMode.MODE_KANJI      : return 12
            raise Exception("mode:" + mode)

        else:
            raise Exception("type:" + type)
dataset/ETHPy150Open bitxbay/BitXBay/electru/build/lib/electrum/pyqrnative.py/QRUtil.getLengthInBits/original