Ascii to binary conversion

John Machin sjmachin at lexicon.net
Sat Aug 9 17:14:10 EDT 2008


On Aug 10, 12:37 am, azrael <jura.gro... at gmail.com> wrote:
[top-posting corrected]
>
> On 9 kol, 15:39, John Machin <sjmac... at lexicon.net> wrote:
>
> > On Aug 9, 11:18 pm, azrael <jura.gro... at gmail.com> wrote:
>
> > > Hy folks,
>
> > > I googled, and searched, and can not bealive that I have not found a
> > > built in way to convert the easy and elegant python way a function to
> > > easily convert simple ascii data to binary and back.
>
> > > I've written some my own but they were pretty slow using binascii
> > > linbrary with hexifly and unhexifly functions conbined with a
> > > lookuptable of binary and hex values.
>
> > > Any idea how to easily write a function that recieves a character or
> > > string and returns a binary number like:
> > > ascii("1") is converted to bin("00110001")

>> why are you doing this so much that the speed matters???

> the speed matters if you plan to exchange about 10 M ascii chars and
> don't wont to wait a year for the results. :)

WHY do you plan to change about 10 M ascii chars into about 90 M
bytes? Who or what is going to consume the output?



More information about the Python-list mailing list