Skip to content

Instantly share code, notes, and snippets.

/rot13-jBrown

Created Sep 12, 2016
Embed
What would you like to do?
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