Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // In Firefox, press Ctrl+Shift+K then copy, paste and run.
- function encode(input)
- {
- var output = "";
- for(var i = 0, length = input.length; i < length; i++)
- {
- var ch = input.charCodeAt(i);
- var chNew = ch;
- if(ch >= 65 && ch <= 90)
- {
- chNew = 90 - ch + 65;
- }
- else if(ch >= 97 && ch <= 122)
- {
- chNew = 122 - ch + 97;
- }
- else if(ch >= 48 && ch <= 57)
- {
- chNew = 57 - ch + 48;
- }
- output += String.fromCharCode(chNew);
- }
- return output;
- }
- encode("AbCzZ 123409");
Advertisement
Add Comment
Please, Sign In to add comment