Martin Morrison added the comment:

Ok, I'm not even sure that Mercurial follows RFC1924! That RFC is specifically 
for encoding IPv6 addresses, and mandates that the calculations be performed on 
a 128bit integer.

The Mercurial implementation seems to follow the Ascii85 policy of taking each 
4 bytes separately and doing 32bit arithmetic, but uses the lookup table from 
RFC1924, and is less lenient about spacing, and has no compression for 
sequences of zeroes.

It therefore looks like Mercurial (and I guess Git) have their own, 
non-standard base64 encoding. The Web at large mostly has "standard" Ascii85 
encoding/decoding described. RFC1924 itself has a Python implementation on 
Github:

https://github.com/drkjam/netaddr/blob/rel-0.7.x/netaddr/ip/rfc1924.py

So I'm not sure what you want to do. I would suggest a standard Ascii85 encoder 
is definitely useful, and provides feature parity with Ruby. If we want the 
standard library to be able to read/write Mercurial/Git base64 encoded files, 
then I guess that can be added too. If we think RFC1924 is useful/used, then 
the implementation in the netaddr lib looks right.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17618>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to