py.lib.aw_web_tools

Yohn Y. 2024-02-25 Parent:06f00ec09030

1:cb0dd8d1c0e9 Go to Latest

py.lib.aw_web_tools/src/aw_web_tools/url.py

Added tag 0.202402.1 for changeset 06f00ec09030

History
1 # coding: utf-8 -*-
2 # Инструменты для работы с URL
3 from base64 import urlsafe_b64encode as _b64e, urlsafe_b64decode as _b64d
4 from urllib.parse import quote, unquote
7 def b64_encode(buf: str) -> str:
8 return _b64e(buf.encode('UTF-8')).decode('UTF-8')
11 def b64_decode(buf: str) -> str:
12 return _b64d(buf.encode('UTF-8')).decode('UTF-8')
15 def url_quote(buf: str) -> str:
16 return quote(buf)
19 def url_unquote(buf: str) -> str:
20 return unquote(buf)