Converting 2bit hex representation to integer ?

M

Madhusudan Singh

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 0x). How do I
convert the resulting two bit representation into an integer ?

Thanks.
 
L

Leif K-Brooks

Madhusudan said:
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
0x).

Surely you mean two-byte?
How do I convert the resulting two bit representation into an integer
?

int(foo, 16)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top