Converting 2bit hex representation to integer ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Madhusudan Singh

    #1

    Converting 2bit hex representation to integer ?

    Hi

    I am using binascii.b2a_he x 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.
  • Leif K-Brooks

    #2
    Re: Converting 2bit hex representation to integer ?

    Madhusudan Singh wrote:[color=blue]
    > I am using binascii.b2a_he x to convert some binary data to hex. The
    > result is a two bit hex representation (i. e., without the leading
    > 0x).[/color]

    Surely you mean two-byte?
    [color=blue]
    > How do I convert the resulting two bit representation into an integer
    > ?[/color]

    int(foo, 16)

    Comment

    Working...