classification
Title: base85 z85 variant encoding
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Dobatymo, pitrou, underrun
Priority: normal Keywords:

Created on 2017-08-03 22:32 by underrun, last changed 2020-02-15 20:08 by SilentGhost.

Messages (3)
msg299724 - (view) Author: Derek Wilson (underrun) Date: 2017-08-03 22:32
Issue #17618 introduced base85 options into the base64 module including b85 and a85/adobe variants.

There has since been introduced a variant that is easier to work with specifically as it avoids " ' \ characters which avoids quoting/escaping issues when working with base85 literals in python, json, xml, etc.

https://rfc.zeromq.org/spec:32/Z85/

there is a reference implementation in c for which an extension could easily be built.

alternately it would be very easy to add a _z85alphabet etc. to the base64 module to mirror what has been done with a/b85.

1) is there any interest in this being in the language
2) if so do we want python impl or c extension around ref impl?
msg361991 - (view) Author: Dobatymo (Dobatymo) Date: 2020-02-14 09:18
base64.b85encode does not use ", ' or \ as well.

That's the _b85alphabet 

_b85alphabet = (b"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                b"abcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~")
msg362026 - (view) Author: Derek Wilson (underrun) Date: 2020-02-15 19:32
z85 avoids all of:

` \ " ' _ , ;

Backtick and semicolon increase the number of places that z85 can be used
without issue over b85. All of these might not be as big an issue in python
as in other tools/languages but interoperability would still be improved
through the addition of z85.

- Derek

On Fri, Feb 14, 2020, 09:18 Dobatymo <report@bugs.python.org> wrote:

>
> Dobatymo <the-real-hazzard@outlook.com> added the comment:
>
> base64.b85encode does not use ", ' or \ as well.
>
> That's the _b85alphabet
>
> _b85alphabet = (b"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
>                 b"abcdefghijklmnopqrstuvwxyz!#$%&()*+-;<=>?@^_`{|}~")
>
> ----------
> nosy: +Dobatymo
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue31116>
> _______________________________________
>
History
Date User Action Args
2020-02-15 20:08:57SilentGhostsetnosy: + pitrou

versions: + Python 3.9, - Python 3.7
2020-02-15 19:32:06underrunsetmessages: + msg362026
2020-02-14 09:18:07Dobatymosetnosy: + Dobatymo
messages: + msg361991
2017-08-03 22:32:22underruncreate