(string)
| 26 | return True |
| 27 | |
| 28 | async def encode(string): |
| 29 | string_bytes = string.encode("ascii") |
| 30 | base64_bytes = base64.urlsafe_b64encode(string_bytes) |
| 31 | base64_string = (base64_bytes.decode("ascii")).strip("=") |
| 32 | return base64_string |
| 33 | |
| 34 | async def decode(base64_string): |
| 35 | base64_string = base64_string.strip("=") # links generated before this commit will be having = sign, hence striping them to handle padding errors. |
no outgoing calls
no test coverage detected