Created
August 25, 2011 02:32
-
-
Save flying19880517/1169835 to your computer and use it in GitHub Desktop.
ROT13加密
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
function rot13(s){ | |
return s.replace(/[a-zA-Z]/g,function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);}) | |
} | |
//document.write(rot13("Hello world")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment