(val)
return ret
Return the binary representation of an integer as string.
Return the binary representation of an integer as string.
Return the binary representation of an integer as string .
def _intToBin(val):
    """Return the binary representation of an integer as string."""

    if val < 0:
        raise ValueError("Only positive Values allowed")
    s = hex(val).lower()
    ret = ''
    if s[-1] == 'l':
        s = s[:-1]
    for x in s[2:]:
        if __debug__:
            if x not in _BitTable:
                raise AssertionError("hex() returned strange result")
        ret += _BitTable[x]
    # remove leading zeros
    while ret[0] == '0' and len(ret) > 1:
        ret = ret[1:]
    return ret
def _intToBin ( val ) : if val < 0 : raise ValueError ( "Only positive Values allowed" ) s = hex ( val ) . lower ( ) ret = '' if s [ - 1 ] == 'l' : s = s [ : - 1 ] for x in s [ 2 : ] : if __debug__ : if x not in _BitTable : raise AssertionError ( "hex() returned strange result" ) ret += _BitTable [ x ] # remove leading zeros while ret [ 0 ] == '0' and len ( ret ) > 1 : ret = ret [ 1 : ] return ret