def encode_frag_archive_bodies(policy, body):
 segment_size = policy.ec_segment_size
 chunks = [body[x:(x + segment_size)] for x in range(0, len(body), segment_size)]
 fragment_payloads = []
 for chunk in chunks:
  fragments = policy.pyeclib_driver.encode(chunk)
  if (not fragments):
   break
  fragment_payloads.append(fragments)
 ec_archive_bodies = [''.join(frags) for frags in zip(*fragment_payloads)]
 return ec_archive_bodies

def encode_frag_archive_bodies ( policy , body ) : segment_size = policy . ec_segment_size chunks = [ body [ x : ( x + segment_size ) ] for x in range ( 0 , len ( body ) , segment_size ) ] fragment_payloads = [ ] for chunk in chunks : fragments = policy . pyeclib_driver . encode ( chunk ) if ( not fragments ) : break fragment_payloads . append ( fragments ) ec_archive_bodies = [ '' . join ( frags ) for frags in zip ( * fragment_payloads ) ] return ec_archive_bodies
given a stub body produce a list of complete frag_archive bodies as strings in frag_index order .