[tahoe-dev] Base32
zooko
zooko at zooko.com
Sat Mar 7 11:08:17 PST 2009
Hello, Jeremy Fishman. Thanks for looking at the tahoe source.
> I personally agree with the use of lowercase, but would this be
> better accomplished via base64.b32encode(...).lower()
There's one more difference, which is visible only when the length of
the input in bytes isn't a multiple of 5:
>>> for l in range(1, 7):
... print base64.b32encode('x'*l).lower(), allmydata.util.base32.b2a
('x'*l)
...
pa====== pa
pb4a==== pb4a
pb4hq=== pb4hq
pb4hq6a= pb4hq6a
pb4hq6dy pb4hq6dy
pb4hq6dypa====== pb4hq6dypa
I figured that it would be roughly as easy to re-use my own zbase32
implementation (which I wrote and therefore like) as to strip the
padding from the output of base64.
I would not reject a patch to replace zbase32 with suitably wrapped
base64, especially if it came with tests of the padding situation and
measurements of performance. :-)
Regards,
Zooko
More information about the tahoe-dev
mailing list