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, andmarker_baseparameters of theCijakclass (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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
804a104571b748ba429023a09a017ff10b94f3b341dde5f1ed98897dda2f94ff
|
|
| MD5 |
b9b8268dc7d43c8795cd139926f75750
|
|
| BLAKE2b-256 |
b4637dbf825439cb7dc7268b25249731985a3271e90658f9e656aa1a405b49c1
|
Provenance
The following attestation bundles were made for cijak-0.1.0.tar.gz:
Publisher:
python-publish.yml on NobreHD/Cijak
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cijak-0.1.0.tar.gz -
Subject digest:
804a104571b748ba429023a09a017ff10b94f3b341dde5f1ed98897dda2f94ff - Sigstore transparency entry: 192905721
- Sigstore integration time:
-
Permalink:
NobreHD/Cijak@e8002c23f8706611f739786533150033f3563afb -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/NobreHD
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@e8002c23f8706611f739786533150033f3563afb -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1b5293a6c901325fc0289605b27b0d2369e4d3d238b41f24ec9aacbda8f91e5
|
|
| MD5 |
708068b32188d58a0e853cda99a74d1f
|
|
| BLAKE2b-256 |
04116ceb4bf77dbab1c720bc55fa3d4d329150dae4d08ee3bf42a4ec826344d5
|
Provenance
The following attestation bundles were made for cijak-0.1.0-py3-none-any.whl:
Publisher:
python-publish.yml on NobreHD/Cijak
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cijak-0.1.0-py3-none-any.whl -
Subject digest:
f1b5293a6c901325fc0289605b27b0d2369e4d3d238b41f24ec9aacbda8f91e5 - Sigstore transparency entry: 192905722
- Sigstore integration time:
-
Permalink:
NobreHD/Cijak@e8002c23f8706611f739786533150033f3563afb -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/NobreHD
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@e8002c23f8706611f739786533150033f3563afb -
Trigger Event:
release
-
Statement type: