Implementation of Crockford's Base32 Encoding?
Gabriel Genellina
gagsl-py2 at yahoo.com.ar
Sun Apr 6 06:15:52 EDT 2008
En Sun, 06 Apr 2008 06:07:18 -0300, Petite Abeille
<petite.abeille at gmail.com> escribió:
> On Apr 6, 2008, at 9:20 AM, samslists at gmail.com wrote:
>
>> Anyone know of a Python implementation of this:
>> http://www.crockford.com/wrmg/base32.html
>
> Not sure about Crockford's Base32 encoding itself, but here is an
> implementation of Bryce "Zooko" Wilcox-O'Hearn's "human-oriented
> base-32 encoding":
>
> https://zooko.com/repos/z-base-32/base32/
> https://zooko.com/repos/z-base-32/base32/DESIGN
The design and rationale looks better. The Crockford version is
ill-defined in the sense that you can't recover the exact input string
length in some cases; by example both "\x00"*4 and "\x00"*5 share the same
encoding.
base-64 encoding, by example, uses '=' as pad bytes at the end to avoid
this problem.
--
Gabriel Genellina
More information about the Python-list
mailing list