Shift characters by 2014.
Code:var HalloCrypt = function(str) { var chars = "HALOWENBCDFGIJKMPQRSTUVXYZ0123456789halowenbcdfgijkmpqrstuvxyz", encryption = "", loc, x; for (x = 0; x < str.length; x++) { loc = chars.indexOf(str[x]); // If the character is in our string of characters, edit it. if (loc != -1) { loc += 2014; loc = loc % chars.length; encryption += chars[loc]; } // Not an alphanumeric character, keep it the same. else encryption += str[x]; } return encryption; }; var DeHalloCrypt = function(str) { var chars = "HALOWENBCDFGIJKMPQRSTUVXYZ0123456789halowenbcdfgijkmpqrstuvxyz", encryption = "", loc, x; for (x = 0; x < str.length; x++) { loc = chars.indexOf(str[x]); // If the character is in our string of characters, edit it. if (loc != -1) { loc -= 2014; while (loc < 0) loc += chars.length; encryption += chars[loc]; } // Not an alphanumeric character, keep it the same. else encryption += str[x]; } return encryption; }; var a = HalloCrypt("This is a test of the emergency Logical Gamers system."); alert(a + "\n" + DeHalloCrypt(a));
Poll Results: 2014 - Most popular programmer goes to....
-
Arti
3 33.33% -
gameCheif
2 22.22% -
Stapled
4 44.44% -
Kings V
0 0%
You may not vote on this poll
9 Votes
Results 1 to 26 of 26
Hybrid View
- 29 Oct. 2014 12:07am #1
Last edited by Stapled; 29 Oct. 2014 at 12:14am.