Skip to content

Instantly share code, notes, and snippets.

@kopiro
Created June 9, 2011 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kopiro/1016590 to your computer and use it in GitHub Desktop.
Save kopiro/1016590 to your computer and use it in GitHub Desktop.
Encrypt in ASCII a string in javascript
javascript:
var s = prompt();
var scoded="String.fromCharCode("; for(var i=0;i<s.length; i++) {
scoded+=s.charCodeAt(i);
if (i<s.length-1) scoded+=",";
}
scoded+=");";
alert(scoded);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment