Skip to content

Instantly share code, notes, and snippets.

Created September 12, 2016 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/3f2b929b44c47bcd2e78db1e116a3bef to your computer and use it in GitHub Desktop.
Save anonymous/3f2b929b44c47bcd2e78db1e116a3bef to your computer and use it in GitHub Desktop.
minimized rot13 function using arrow function notation and map.
rot13 = m => m.split("")
.map(b=>{
x = b.charCodeAt();
return x>96 && x<123 ? String.fromCharcode((x-84)%26+97) : x>64 && x<91 ? String.fromCharCode((x-52)%26+65) : b})
.join("")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment