How to transform decimal to base64

Christos TZOTZIOY Georgiou tzot at sil-tec.gr
Sat Aug 30 08:27:08 EDT 2003


On Sat, 30 Aug 2003 19:41:23 +0800, rumours say that "He Qiang"
<hq1998 at 263.net> might have written:

>base64 module only provide interface for string to base64, I want to know
>how to transform decimal digit to base64.
>For example, 1 -> base64, not "1".

chr(1).encode("base64")

If you have many bytes to convert, you can use an array.array('B') and,
when you have built the array, then use its .tostring() method.
-- 
TZOTZIOY, I speak England very best,
Microsoft Security Alert: the Matrix began as open source.




More information about the Python-list mailing list