Skip to content

Instantly share code, notes, and snippets.

@bulatie
Created May 14, 2019 07:56
Show Gist options
  • Save bulatie/92bf7544701aae91c5d8291cf9f55173 to your computer and use it in GitHub Desktop.
Save bulatie/92bf7544701aae91c5d8291cf9f55173 to your computer and use it in GitHub Desktop.
convert binary string to hex list in python2
# https://stackoverflow.com/questions/14678132/python-hexadecimal
iv = '\xf3\xc2\xafw:\r}k'
res = ''
for i in iv:
res = res + "{:#04x}".format(ord(i)) + ", "
print res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment