Skip to main content

A Unicode-based encoding and decoding library

Project description

Cijak

Cijak is a Python library that provides a unique encoding and decoding mechanism using Unicode characters. It takes advantage of the CJK Unicode block to encode up to 14 bits of data per character. The name "Cijak" originates from the CJK Unicode block, where it's possible to encode 14 bits of data (C1J4K).

Key Features

  • Encoding and Decoding of binary data using Unicode characters;
  • Uses the CJK Unicode block to encode data by default, but can be configured to use other Unicode characters.

Technical Details

  • The Unicode range can be customized by adjusting the unicode_range_start, unicode_range_end, and marker_base parameters of the Cijak class (note that the range of characters should not contain any control characters to ensure correct functionality);
  • Modifying the default Unicode range allows for adjusting the amount of bits that can be encoded per character, with the library automatically calculating the available bits based on the specified range, which should be provided as UTF-16 code units (eg. 0x4E00 for the first CJK character).

Uses

Cijak provides character-efficient encoding for scenarios where character limits are a concern. It achieves this by using a base16384 alphabet, encoding 14 bits per character, which is more efficient than base64's 6 bits per character. Despite a larger size increase (72% vs. base64's 33%), Cijak's character density makes it valuable for sending short messages on Unicode-supporting platforms with character restrictions, such as social media and messaging apps.

Installation

pip install cijak

Examples

To get started with Cijak, you can use the following examples:

from cijak import Cijak
cijak_encoding = Cijak()
data = b'Hello, World!' # You can replace this with any binary data
encoded_data = cijak_encoding.encode(data)
print(encoded_data) # ㇈怙擆羼稠毛蔦羐漀

decoded_data = cijak_encoding.decode(encoded_data)
print(decoded_data) # b'Hello, World!'

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

cijak-0.1.0.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cijak-0.1.0-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

Details for the file cijak-0.1.0.tar.gz.

File metadata

  • Download URL: cijak-0.1.0.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for cijak-0.1.0.tar.gz
Algorithm Hash digest
SHA256 804a104571b748ba429023a09a017ff10b94f3b341dde5f1ed98897dda2f94ff
MD5 b9b8268dc7d43c8795cd139926f75750
BLAKE2b-256 b4637dbf825439cb7dc7268b25249731985a3271e90658f9e656aa1a405b49c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for cijak-0.1.0.tar.gz:

Publisher: python-publish.yml on NobreHD/Cijak

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cijak-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: cijak-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for cijak-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f1b5293a6c901325fc0289605b27b0d2369e4d3d238b41f24ec9aacbda8f91e5
MD5 708068b32188d58a0e853cda99a74d1f
BLAKE2b-256 04116ceb4bf77dbab1c720bc55fa3d4d329150dae4d08ee3bf42a4ec826344d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for cijak-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on NobreHD/Cijak

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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