(self, text:str)
| 154 | return Base64Item(original_text=text, fixed=new_text) |
| 155 | |
| 156 | def _decode(self, text:str)->Base64Item: |
| 157 | item = Base64Item () |
| 158 | try: |
| 159 | item.original_text = text |
| 160 | item.fixed = self._complete_padding(text).fixed |
| 161 | item.content = b64decode(text) |
| 162 | |
| 163 | except Error as be: |
| 164 | if str(be) == 'Incorrect padding': |
| 165 | fixed_text = self._complete_padding(text).fixed |
| 166 | item.content = b64decode(fixed_text) |
| 167 | |
| 168 | except Exception as ex: |
| 169 | AnsiPrint.print_debug(ex) |
| 170 | |
| 171 | return item |
| 172 | |
| 173 | |
| 174 | def get_from_base64(self, text:str) -> Base64File: |
no test coverage detected