base91x encoding/decoding library
Project description
base91x
https://pypi.org/project/base91x/
This base91x method provides data encoding and decoding using numeric system of base 91 with specific alphabet that does not require escaping any symbols in C, C++ (and many other languages?) string. 'x' - means the alphabet was obtained with XOR function.
The alphabet contains visible printable characters of ASCII except:
"
Quotation mark
'
Apostrophe
\
Backslash
An encoded string might be used for JSON string if JSON does not require to escape / Slash.
Encoded string size ~ 16 * original size / 13.
There is possibility to extend the algorithm to use 89 codes during decode.
The alphabet transforms from base91 value with operation XOR(0x7F) with the tree exceptions.
The alphabet in the order:
!~}|{zyxwvutsrqponmlkjihgfedcba`_^]#[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)($&%
PAY ATTENTION:
Encoded string may have awkwardly sequence /*
or */
It may hurt C or C++ code when the string is placed into code.
But sequence %%% should not appear. So, encoded string might be placed with raw string literal:
char string[]=R"%%%( a string )%%%";
Workaround: use space | line feed | tab in encoded text to break wrong sequence due the algorithm skips non alphabet symbols.
e.g. Ma^7*/0629
-> Ma^7* /0629
The algorithm is not compatible with https://base91.sourceforge.net/
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
File details
Details for the file base91x-1.0.1.tar.gz
.
File metadata
- Download URL: base91x-1.0.1.tar.gz
- Upload date:
- Size: 117.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92cedb90274a4951e519f6345f607fe114cfdfffba9c8480342d821e4390485d |
|
MD5 | 04cb1411f05284c4e9a8b678f2103e70 |
|
BLAKE2b-256 | f2cde8daa80cc7a95f35f8d146db2fcae934afa8a70457f20d30b4ab3f8874c1 |
File details
Details for the file base91x-1.0.1-py3-none-any.whl
.
File metadata
- Download URL: base91x-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b07fff02d8f5fb917e5be454eef4ad73d35f36fae9ed824203bcd8286239847 |
|
MD5 | eaad4f13c30084e53b414e4aaacca2e7 |
|
BLAKE2b-256 | 1430784c04d0947c94885fe6256add5b4c5d11dd5df19c535e8a797217f95141 |