Skip to content

Instantly share code, notes, and snippets.

@packetchef
Created November 20, 2015 19:14
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 packetchef/b2a071e2e9c1c58814fe to your computer and use it in GitHub Desktop.
Save packetchef/b2a071e2e9c1c58814fe to your computer and use it in GitHub Desktop.
# Encode ASCII to hex
'password'.encode("hex")
# Decode hex to ASCII
'70617373776f7264'.decode("hex")
# >>> '\x70\x61\x73\x73\x77\x6f\x72\x64'
# 'password'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment