py.lib.aw_web_tools

Yohn Y. 2024-11-09 Parent:06f00ec09030

9:9c734271dcf2 Go to Latest

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

.. 1.202411.2 + Поддержка Authelia

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)