(self, data)
return result
Turn the string data, into a list of bits (1, 0)'s
Turn the string data, into a list of bits (1, 0)'s
Turn the string data into a list of bits ( 1 0 ) s
def __String_to_BitList(self, data):
        """Turn the string data, into a list of bits (1, 0)'s"""
        if _pythonMajorVersion < 3:
            # Turn the strings into integers. Python 3 uses a bytes
            # class, which already has this behaviour.
            data = [ord(c) for c in data]

        result = [False] * len(data) * 8
        pos = 0
        for ch in data:
            result[pos + 0] = (ch & (1 << 7) != 0)
            result[pos + 1] = (ch & (1 << 6) != 0)
            result[pos + 2] = (ch & (1 << 5) != 0)
            result[pos + 3] = (ch & (1 << 4) != 0)
            result[pos + 4] = (ch & (1 << 3) != 0)
            result[pos + 5] = (ch & (1 << 2) != 0)
            result[pos + 6] = (ch & (1 << 1) != 0)
            result[pos + 7] = (ch & (1 << 0) != 0)
            pos += 8

        return result
def __String_to_BitList ( self , data ) : if _pythonMajorVersion < 3 : # Turn the strings into integers. Python 3 uses a bytes # class, which already has this behaviour. data = [ ord ( c ) for c in data ] result = [ False ] * len ( data ) * 8 pos = 0 for ch in data : result [ pos + 0 ] = ( ch & ( 1 << 7 ) != 0 ) result [ pos + 1 ] = ( ch & ( 1 << 6 ) != 0 ) result [ pos + 2 ] = ( ch & ( 1 << 5 ) != 0 ) result [ pos + 3 ] = ( ch & ( 1 << 4 ) != 0 ) result [ pos + 4 ] = ( ch & ( 1 << 3 ) != 0 ) result [ pos + 5 ] = ( ch & ( 1 << 2 ) != 0 ) result [ pos + 6 ] = ( ch & ( 1 << 1 ) != 0 ) result [ pos + 7 ] = ( ch & ( 1 << 0 ) != 0 ) pos += 8 return result