Conversion of Hex bytes to binary and vice versa
Posted by dharshana.ve (dharshana.ve), 9 November 2006Hi all,
I have to convert a hex byte [eg: 0x2A] into its binary form [eg:00101010]. The input is always only one byte that is 8 bits.
I tried using pack() and unpack(). But i am unable to get desired results.
The desired output should look like the following:
0x0a => 00001010
0x23 => 00100011
Can anyone suggest me for the same?
Posted by admin (Graham Ellis), 9 November 2006I understand that this query has now been answered ... see the next thread for a related issue / discussion.
PH: 01225 708225 • FAX: 01225 793803 • EMAIL: firstname.lastname@example.org • WEB: http://www.wellho.net • SKYPE: wellho