Skip to content

Instantly share code, notes, and snippets.

@Climax777
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Climax777/e3db8513a0f3d90b6bdf to your computer and use it in GitHub Desktop.
Save Climax777/e3db8513a0f3d90b6bdf to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
#GistID: e3db8513a0f3d90b6bdf
import binascii
import sys
def hextoimei(hexstring):
hexstring = hexstring.replace(" ", "")
hexstring = hexstring.replace("0x", "")
hexstring = hexstring.replace("0X", "")
return int.from_bytes(binascii.a2b_hex(hexstring), byteorder="little")
if __name__ == "__main__":
if len(sys.argv) > 1:
for arg in sys.argv[1:]:
print(hextoimei(arg))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment