Created
August 8, 2012 18:35
-
-
Save rlemon/3297381 to your computer and use it in GitHub Desktop.
ROT13 in js
This file contains 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
["string"].map(function(a){return(a=(a)?a:this).split("").map(function(b){if(!b.match(/[A-Za-z]/)){return b}c=b.charCodeAt(0)>=96;k=(b.toLowerCase().charCodeAt(0)-96+12)%26+1;return String.fromCharCode(k+(c?96:64))}).join("")}).join(""); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment