Skip to main content

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


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)

Uploaded Source

Built Distribution

mojipack-2.0.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

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

Hashes for mojipack-2.0.0.tar.gz
Algorithm Hash digest
SHA256 4d0d3f87209230e88cf4424411c83b0e328318a2c96f95c848a876d4ef028ca6
MD5 374a880e89f0d84035bf468b4c6043b6
BLAKE2b-256 296504d4875a34b66b4b79e02143cca2467c465d4ddc3e472df7a1c88c74b38f

See more details on using hashes here.

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

Hashes for mojipack-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a7587ae240716c62176d994487bf4bf2a1a691dc9864e9f869d65b9e45687d0
MD5 a2a0ca9890d40e538c1db56fba0a1afd
BLAKE2b-256 761ebe6de821757e0588397202e0226a7147c374ea33a5fe2f78fbc19341b56d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page