py.lib
2017-04-09
py.lib/awNet/webapp/tool/url.py
awNet/webapp/tool/url.py awNet/webapp/win.py
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/awNet/webapp/tool/url.py Sun Apr 09 15:04:18 2017 +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')