def encode(self, input, final=False): assert self.errors == 'strict' return base64.encodebytes(input)