Created
December 14, 2021 01:24
-
-
Save leveled/539b57c5ebd99746bfc9f4c8ef6d364a to your computer and use it in GitHub Desktop.
convert bytes to hex string and vice-versa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| >>> b'\xde\xad\xbe\xef'.hex() | |
| 'deadbeef' | |
| and reverse: | |
| >>> bytes.fromhex('deadbeef') | |
| b'\xde\xad\xbe\xef' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment