[Verba] Nemesis Coding
Stuart D. Gathman
stuart at gathman.org
Sun Jan 22 00:27:31 EST 2006
On Sat, 21 Jan 2006, Taylor Solomon wrote:
> So I have got this
>
> i = int('010000100110100101101110011000010111001001111001', 0)
>
> chr(i)
>
> What am I doing wrong?
Perhaps you meant this:
i = int('010000100110100101101110011000010111001001111001', 2)
That will convert the binary string to a (large) number. That large
number will then need to be decomposed base 256 to get the 8 bit bytes
that can be converted to characters.
My solution splits the binary string into 8 bit pieces first. Either
way will work. I'll post my solution after you've chewed it over a bit
more.
--
Stuart D. Gathman <stuart at bmsi.com>
Business Management Systems Inc. Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flamis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.
More information about the Verba
mailing list