Encode binary data into fun emoji strings!
Project description
Mojipack
Encode any collection of bytes into a fun square of emojis. It's like base64, but more colourful!
๐ฆโ๐โ๐บโ๐ฆโ๐โ๐ฅฐโ๐โ๐ฆโ๐ฉโ๐ตโ๐ขโ๐ฆ
๐โ๐โ๐โ๐โ๐โ๐โโฐโ๐ชโ๐โ๐โ๐โ๐
๐โ๐ธโ๐งกโ๐โ๐โ๐ตโ๐โ๐ทโ๐โ๐โ๐ขโ๐บ
๐โ๐ถโ๐โ๐ปโ๐ธโ๐ขโ๐โ๐ญโ๐โ๐ฐโ๐โ๐
๐คโ๐ฏโ๐โ๐ซโ๐คโ๐คโ๐ซโ๐โ๐คงโ๐ตโ๐ฃโ๐บ
๐บโ๐คงโ๐ฏโ๐คโ๐โ๐โ๐ปโ๐ทโ๐ฑโ๐โ๐โ๐น
๐โ๐คญโ๐ชโ๐ชโ๐โ๐ชโ๐โ๐ฆโ๐ฐโ๐ฐโ๐ฑโ๐ฑ
๐โ๐โ๐ขโ๐คงโ๐บโ๐บโ๐โ๐โ๐คงโ๐ชโ๐โ๐ฆ
๐ฆโโฐโ๐โ๐ขโ๐ปโ๐ฑโ๐โ๐ญโ๐โ๐คงโ๐โ๐ป
๐โ๐ซโ๐ทโ๐คโ๐ฑโ๐คฏโ๐ฅดโ๐คฏโ๐บโ๐ฆโ๐ฅดโ๐
๐โ๐โ๐ถโ๐คโ๐โ๐ฏโ๐ขโ๐โ๐นโ๐โ๐ซโ๐
๐โ๐โ๐โ๐ทโ๐โ๐คงโ๐ตโ๐โ๐คฏโ๐โ๐โ๐
๐คโ๐คญโ๐โ๐โ๐โ๐ฐโ๐
Installation
Mojipack is on PyPI! So all you need to get started is to install it with pip:
pip install mojipack
Usage
Here is how you create a mojipack encoded payload. The example uses msgpack for inner encoding. You could also use UTF-8 encoded json if you don't want to install more packages.
import mojipack
import msgpack
data = msgpack.packb(
{
"name": "Jane Doe",
"age": 21,
"city": "New York",
"is_student": False
},
use_bin_type=True
)
output = mojipack.encode(data)
print(output)
Decoding is just as simple:
import mojipack
import msgpack
MOJIPACK_MESSAGE = "๐ฆโ๐โ๐บโ๐ฆโ๐โ๐ฅฐโ๐โ๐ฆโ๐ฉโ ..."
data = mojipack.decode(MOJIPACK_MESSAGE)
print(
repr(
msgpack.unpackb(data)
)
)
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
mojipack-2.0.0.tar.gz
(15.9 kB
view details)
Built Distribution
File details
Details for the file mojipack-2.0.0.tar.gz
.
File metadata
- Download URL: mojipack-2.0.0.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d0d3f87209230e88cf4424411c83b0e328318a2c96f95c848a876d4ef028ca6 |
|
MD5 | 374a880e89f0d84035bf468b4c6043b6 |
|
BLAKE2b-256 | 296504d4875a34b66b4b79e02143cca2467c465d4ddc3e472df7a1c88c74b38f |
File details
Details for the file mojipack-2.0.0-py3-none-any.whl
.
File metadata
- Download URL: mojipack-2.0.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a7587ae240716c62176d994487bf4bf2a1a691dc9864e9f869d65b9e45687d0 |
|
MD5 | a2a0ca9890d40e538c1db56fba0a1afd |
|
BLAKE2b-256 | 761ebe6de821757e0588397202e0226a7147c374ea33a5fe2f78fbc19341b56d |