py.lib
2020-07-24
Parent:awNet/webapp/tool/url.py@5236a9505448
py.lib/webapp/tool/url.py
.. Реструктуризация
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/webapp/tool/url.py Fri Jul 24 14:40:37 2020 +0300 1.3 @@ -0,0 +1,12 @@ 1.4 +# -*- coding: utf-8 -*- 1.5 +# --- 1.6 +# Инструменты для работы с URL 1.7 +# --- 1.8 +from base64 import urlsafe_b64encode as _b64e, urlsafe_b64decode as _b64d 1.9 +from urllib.parse import quote as urlquote 1.10 + 1.11 +def encode(buf): 1.12 + return _b64e(buf.encode('UTF-8')).decode('UTF-8') 1.13 + 1.14 +def decode(buf): 1.15 + return _b64d(buf.encode('UTF-8')).decode('UTF-8')