Base64 编码
(data: Union[str, bytes])
| 542 | |
| 543 | |
| 544 | def base64_encode(data: Union[str, bytes]) -> str: |
| 545 | """Base64 编码""" |
| 546 | if isinstance(data, str): |
| 547 | data = data.encode('utf-8') |
| 548 | |
| 549 | return base64.b64encode(data).decode('utf-8') |
| 550 | |
| 551 | |
| 552 | def base64_decode(data: str) -> str: |
nothing calls this directly
no outgoing calls
no test coverage detected