def string_to_bitlist(data):
 data = [ord(c) for c in data]
 result = []
 for ch in data:
  i = 7
  while (i >= 0):
   if ((ch & (1 << i)) != 0):
    result.append(1)
   else:
    result.append(0)
   i -= 1
 return result

def string_to_bitlist ( data ) : data = [ ord ( c ) for c in data ] result = [ ] for ch in data : i = 7 while ( i >= 0 ) : if ( ( ch & ( 1 << i ) ) != 0 ) : result . append ( 1 ) else : result . append ( 0 ) i -= 1 return result
transform from ascii string to bit list .