Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```
- def base64_url_encode(text):
- return base64.b64encode(text).replace('+', '-').replace('/', '_').replace('=', '')
- def base64_url_decode(text):
- text = text.replace('-', '+').replace('_', '/')
- while True:
- try:
- result = base64.b64decode(text)
- except TypeError:
- text += '='
- else:
- break
- return result
- ```
Add Comment
Please, Sign In to add comment