Base64 with UTF-8 str input and output
Project description
b64s - Base64 with UTF-8 str input and output
The b64s
module provides
two simple functions, encode and decode, that thinly wrap functionality
from the base64 module in
the standard library, so that:
- All arguments and return values are
str. - UTF-8 encoding is assumed and used.
License
This software is public domain. It is released under CC0 1.0 Universal, a public domain dedication.
See COPYING for
details.
Usage
You can install the PyPI package, or clone the repository.
>>> import b64s
>>> b64s.encode('The Hebrew phrase for “snowboarder” is גולש סנובורד. 🏂')
'VGhlIEhlYnJldyBwaHJhc2UgZm9yIOKAnHNub3dib2FyZGVy4oCdIGlzINeS15XXnNepINeh16DXldeR15XXqNeTLiDwn4+C'
>>> b64s.decode('VGhlIEhlYnJldyBwaHJhc2UgZm9yIOKAnHNub3dib2FyZGVy4oCdIGlzINeS15XXnNepINeh16DXldeR15XXqNeTLiDwn4+C')
'The Hebrew phrase for “snowboarder” is גולש סנובורד. 🏂'
What’s here
The interesting files are:
b64s/__init__.py–encodeanddecodefunctions.test_b64s.py– Unit tests.scratchpad.ipynb– Notebook for trying things out.
Acknowledgements
Thanks to Michael Kagan for help with one of the examples.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file b64s-0.1.0.tar.gz.
File metadata
- Download URL: b64s-0.1.0.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.1 CPython/3.11.2 Linux/5.15.90.1-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87004f748199458063afdc60374666769154ba4a0f60a7a4a7a32c157d2acb49
|
|
| MD5 |
841226a64514a3f06cd9785f8ffcb4ab
|
|
| BLAKE2b-256 |
ebda91104d0e27f5de786b72f4bbaf46e11ad9fe9ce0ea590e26582b9fe86e74
|
File details
Details for the file b64s-0.1.0-py3-none-any.whl.
File metadata
- Download URL: b64s-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.1 CPython/3.11.2 Linux/5.15.90.1-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18f88fce254239df692dff4e56611f0db3ff059e33295d6c5bb621b412708542
|
|
| MD5 |
43f98fc57d77cb3842707e05bc24fb79
|
|
| BLAKE2b-256 |
5fe85992ec3a90e6687d44155b2f3dc8e1fe53f6b2ac6046c34c94ef30280ad5
|