def encode_trailing_data(raw):
 lsize = 1
 while True:
  encoded = encint((len(raw) + lsize), forward=False)
  if (len(encoded) == lsize):
   break
  lsize += 1
 return (raw + encoded)

def encode_trailing_data ( raw ) : lsize = 1 while True : encoded = encint ( ( len ( raw ) + lsize ) , forward = False ) if ( len ( encoded ) == lsize ) : break lsize += 1 return ( raw + encoded )
given some data in the bytestring raw .