Created
September 27, 2016 08:19
-
-
Save coreequip/b3edffb86a6f5249e57eb9051a48b9f7 to your computer and use it in GitHub Desktop.
ROT13 JavaScript One-Liner
This file contains hidden or 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
// var s = 'text'; | |
s.replace(/[a-zA-Z]/g,function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);}); | |
// "grkg" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment