Created
May 21, 2021 04:49
-
-
Save Tsugami/41774b0bd3b7ead0bd369abbe0afeabe to your computer and use it in GitHub Desktop.
This file contains 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
def char_to_hex(char): | |
return char.encode('utf-8').hex() | |
def string_to_hex(string): | |
chars = list(string) | |
hex_chars = map(char_to_hex, chars) | |
return "".join(hex_chars) | |
print(string_to_hex("char")) | |
# 63686172 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment