base91x


Namebase91x JSON
Version 1.0.1 PyPI version JSON
download
home_pageNone
Summarybase91x encoding/decoding library
upload_time2024-04-29 08:50:45
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords base91x decode encode
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # base91x
https://pypi.org/project/base91x/


[![Test](https://github.com/babenek/base91x/actions/workflows/main.yml/badge.svg)](https://github.com/babenek/base91x/actions/workflows/main.yml)
[![codecov](https://codecov.io/gh/babenek/base91x/branch/main/graph/badge.svg)](https://codecov.io/gh/babenek/base91x)
[![GitHub release (latestSemVer)](https://img.shields.io/github/v/release/babenek/base91x)](https://github.com/babenek/base91x/releases)
[![PyPI](https://img.shields.io/pypi/v/base91x)](https://pypi.org/project/base91x/)
[![License](https://img.shields.io/badge/licence-MIT-green.svg?style=flat)](LICENSE)
[![Python](https://img.shields.io/pypi/pyversions/base91x.svg)](https://badge.fury.io/py/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/

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "base91x",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "base91x, decode, encode",
    "author": null,
    "author_email": "Roman Babenko <babenek@users.noreply.github.com>",
    "download_url": "https://files.pythonhosted.org/packages/f2/cd/e8daa80cc7a95f35f8d146db2fcae934afa8a70457f20d30b4ab3f8874c1/base91x-1.0.1.tar.gz",
    "platform": null,
    "description": "# base91x\nhttps://pypi.org/project/base91x/\n\n\n[![Test](https://github.com/babenek/base91x/actions/workflows/main.yml/badge.svg)](https://github.com/babenek/base91x/actions/workflows/main.yml)\n[![codecov](https://codecov.io/gh/babenek/base91x/branch/main/graph/badge.svg)](https://codecov.io/gh/babenek/base91x)\n[![GitHub release (latestSemVer)](https://img.shields.io/github/v/release/babenek/base91x)](https://github.com/babenek/base91x/releases)\n[![PyPI](https://img.shields.io/pypi/v/base91x)](https://pypi.org/project/base91x/)\n[![License](https://img.shields.io/badge/licence-MIT-green.svg?style=flat)](LICENSE)\n[![Python](https://img.shields.io/pypi/pyversions/base91x.svg)](https://badge.fury.io/py/base91x)\n\nThis base91x method provides data encoding and decoding \nusing numeric system of base 91 with specific alphabet that does not require\nescaping any symbols in C, C++ (and many other languages?) string.\n'x' - means the alphabet was obtained with XOR function.\n\n\nThe alphabet contains visible printable characters of ASCII except:\n\n`\"` Quotation mark\n\n`'` Apostrophe\n\n`\\` Backslash\n\nAn encoded string might be used for JSON string if JSON does not require to escape / Slash.\n\nEncoded string size ~ 16 * original size / 13.\n\nThere is possibility to extend the algorithm to use 89 codes during decode.\n\nThe alphabet transforms from base91 value with operation XOR(0x7F) with the tree exceptions.\n\nThe alphabet in the order:\n\n```\n!~}|{zyxwvutsrqponmlkjihgfedcba`_^]#[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)($&%\n```\n\n### PAY ATTENTION:\nEncoded string may have awkwardly sequence ``/*`` or ``*/``\nIt may hurt C or C++ code when the string is placed into code.\nBut sequence %%% should not appear. So, encoded string might be placed with raw string literal:\n\nchar string[]=R\"%%%( a string )%%%\";\n\nWorkaround: use space | line feed | tab in encoded text to break wrong sequence due the algorithm skips non alphabet symbols.\ne.g. ``Ma^7*/0629`` -> ``Ma^7* /0629``\n\nThe algorithm is not compatible with https://base91.sourceforge.net/\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "base91x encoding/decoding library",
    "version": "1.0.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/babenek/base91x/issues",
        "Homepage": "https://github.com/babenek/base91x"
    },
    "split_keywords": [
        "base91x",
        " decode",
        " encode"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1430784c04d0947c94885fe6256add5b4c5d11dd5df19c535e8a797217f95141",
                "md5": "eaad4f13c30084e53b414e4aaacca2e7",
                "sha256": "2b07fff02d8f5fb917e5be454eef4ad73d35f36fae9ed824203bcd8286239847"
            },
            "downloads": -1,
            "filename": "base91x-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "eaad4f13c30084e53b414e4aaacca2e7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 6642,
            "upload_time": "2024-04-29T08:50:44",
            "upload_time_iso_8601": "2024-04-29T08:50:44.063262Z",
            "url": "https://files.pythonhosted.org/packages/14/30/784c04d0947c94885fe6256add5b4c5d11dd5df19c535e8a797217f95141/base91x-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f2cde8daa80cc7a95f35f8d146db2fcae934afa8a70457f20d30b4ab3f8874c1",
                "md5": "04cb1411f05284c4e9a8b678f2103e70",
                "sha256": "92cedb90274a4951e519f6345f607fe114cfdfffba9c8480342d821e4390485d"
            },
            "downloads": -1,
            "filename": "base91x-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "04cb1411f05284c4e9a8b678f2103e70",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 117508,
            "upload_time": "2024-04-29T08:50:45",
            "upload_time_iso_8601": "2024-04-29T08:50:45.810922Z",
            "url": "https://files.pythonhosted.org/packages/f2/cd/e8daa80cc7a95f35f8d146db2fcae934afa8a70457f20d30b4ab3f8874c1/base91x-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-29 08:50:45",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "babenek",
    "github_project": "base91x",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "base91x"
}
        
Elapsed time: 8.23397s