Created
May 17, 2017 17:21
-
-
Save Hamza5/e91ab75343b8b152ff2dc74a62ab74bb to your computer and use it in GitHub Desktop.
Text to hexadecimal 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
function decrypt(s){ | |
return s.split(" ").map(function(c){return String.fromCharCode(parseInt(c,16))}).join(""); | |
} | |
function encrypt(s) { | |
return s.split("").map(function(c){return c.codePointAt(c).toString(16)}).join(" "); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment