def encode(self, data):
        '''Encode a message (ie, add the ecc symbols) using Reed-Solomon, whatever the length of the message because we use chunking'''
        if isinstance(data, str):
            data = bytearray(data, "latin-1")
        chunk_size = self.nsize - self.nsym
        enc = bytearray()
        for i in xrange(0, len(data), chunk_size):
            chunk = data[i:i+chunk_size]
            enc.extend(rs_encode_msg(chunk, self.nsym, fcr=self.fcr, generator=self.generator))
        return enc
def encode ( self , data ) : if isinstance ( data , str ) : data = bytearray ( data , "latin-1" ) chunk_size = self . nsize - self . nsym enc = bytearray ( ) for i in xrange ( 0 , len ( data ) , chunk_size ) : chunk = data [ i : i + chunk_size ] enc . extend ( rs_encode_msg ( chunk , self . nsym , fcr = self . fcr , generator = self . generator ) ) return enc
Encode a message (ie, add the ecc symbols) using Reed-Solomon, whatever the length of the message because we use chunking