def serialize(self):
    return {'type': self.type, 'body': base64.b64encode(self.fp.read()).decode('utf-8'), 'phrase': self.phrase, 'case': self.case, 'numeric': self.numeric, 'math': self.math, 'minLength': self.minLength, 'maxLength': self.maxLength}
def serialize(self):
    return {'type': self.type, 'body': base64.b64encode(self.fp.read()).decode('utf-8'), 'phrase': self.phrase, 'case': self.case, 'numeric': self.numeric, 'math': self.math, 'minLength': self.minLength, 'maxLength': self.maxLength}