-
-
Save teebow1e/5a5ccd2dcf5fe0ffbcdb14c140f3dab3 to your computer and use it in GitHub Desktop.
string -> string.fromcharcode js - xss
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 string_to_fromcharcode(input_string): | |
# Convert each character in the string to its char code | |
char_codes = [str(ord(char)) for char in input_string] | |
# Create the JavaScript String.fromCharCode representation | |
fromcharcode_str = "String.fromCharCode(" + ",".join(char_codes) + ")" | |
return fromcharcode_str | |
# Example usage | |
input_string = input() | |
result = string_to_fromcharcode(input_string) | |
print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment