Converting 2bit hex representation to integer ?

Larry Bates larry.bates at websafe.com
Wed Oct 19 12:22:21 EDT 2005


Can you give us an example.  I don't know what two bit
hex means (takes at least 4 bits to make a hex digit).

Now I'm going to try to guess:

If the data is binary then all you need to do is to
use the struct.unpack module to convert to integer.

Larry Bates

Madhusudan Singh wrote:
> Hi
> 
> I am using binascii.b2a_hex to convert some binary data to hex. The result
> is a two bit hex representation (i. e., without the leading hex). How do I
> convert the resulting two bit representation into an integer ?
> 
> Thanks.



More information about the Python-list mailing list