Last active
June 27, 2017 23:24
-
-
Save Paturages/6da07a24f5733c06bba88bbed586bb10 to your computer and use it in GitHub Desktop.
JavaScript ROT13 (code golf)
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
// 105 chars: Common characters only | |
m=>String.fromCharCode(...[].map.call(m,x=>x.charCodeAt()).map(x=>x<65?x:x<110?x<78|x>95?x+13:x-13:x-13)) | |
// 123 chars: Full character support | |
m=>String.fromCharCode(...[].map.call(m,x=>x.charCodeAt()).map(x=>x<65|x>122|(x>90&x<97)?x:x<110?x<78|x>95?x+13:x-13:x-13)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment