Skip to content

Instantly share code, notes, and snippets.

@Hamza5
Created May 17, 2017 17:21
Show Gist options
  • Save Hamza5/e91ab75343b8b152ff2dc74a62ab74bb to your computer and use it in GitHub Desktop.
Save Hamza5/e91ab75343b8b152ff2dc74a62ab74bb to your computer and use it in GitHub Desktop.
Text to hexadecimal and vice versa
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