py.lib

Yohn Y. 2022-02-23 Parent:cab7fedf8432

23:1668cc57225b Go to Latest

py.lib/webapp/tool/url.py

. Рефакторинг бессмысленный и беспощадный

History
awgur@2 1 # -*- coding: utf-8 -*-
awgur@2 2 # ---
awgur@2 3 # Инструменты для работы с URL
awgur@2 4 # ---
awgur@2 5 from base64 import urlsafe_b64encode as _b64e, urlsafe_b64decode as _b64d
awgur@2 6 from urllib.parse import quote as urlquote
awgur@2 7
awgur@2 8 def encode(buf):
awgur@2 9 return _b64e(buf.encode('UTF-8')).decode('UTF-8')
awgur@2 10
awgur@2 11 def decode(buf):
awgur@2 12 return _b64d(buf.encode('UTF-8')).decode('UTF-8')