Training, Open Source computer languages

This is page http://www.wellho.net/forum/Perl-Programming/Conversi ... versa.html

Our email: info@wellho.net • Phone: 01144 1225 708225

 
Python, Lua and Tcl - public course schedule [here]
Private courses on your site - see [here]
Please ask about maintenance training for Perl, PHP, Java, C, C++, Ruby, MySQL and Linux / Tomcat systems

Phone System reconfiguration 11.1.2018 to 26.1.2018 - we are on email but incoming landline not available. Temp number 0797 4 925928
 
Conversion of Hex bytes to binary and vice versa

Posted by dharshana.ve (dharshana.ve), 9 November 2006
Hi 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 2006
I understand that this query has now been answered ... see the next thread for a related issue / discussion.



This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

© WELL HOUSE CONSULTANTS LTD., 2018: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho