0

Given netmask in hex format e.g.0xffffff00 (or sometimes without the '0x' in front), I would like to convert it into dotted decimal format e.g.255.255.255.0.

What I have tried so far:

print binascii.a2b_hex("0xffffff00")

print bytearray.fromhex("ffffff00").decode()

mystring = "0xffffff00"
print mystring.decode('hex')

But the error returned states "non-hexadecimal digit found". May I know what am I doing wrong that I'm not aware of?

axaxa
  • 3
  • 3

0 Answers0