honwhy / urlsafe-base64-py

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

URL Safe Base64

URL Safe Base64 util module for Python applications

Usage

import and use

>>> import urlsafe_base64_py as ubp
>>> ubp.encode("helloworld")
'aGVsbG93b3JsZA'
>>> ubp.decode("aGVsbG93b3JsZA")
'helloworld'
>>>

.encode(string)

Encodes a string as a URL Safe Base64 string. This function encodes to the RFC 4648 Spec where '+' is encoded as '-' and '/' is encoded as '_'. The padding character '=' is removed.

.decode(string)

Decodes a URL Safe Base64 string as a string.

Inspires by

About


Languages

Language:Rust 100.0%