Skip to content

Instantly share code, notes, and snippets.

@rlemon
Created August 8, 2012 18:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rlemon/3297381 to your computer and use it in GitHub Desktop.
Save rlemon/3297381 to your computer and use it in GitHub Desktop.
ROT13 in js
["string"].map(function(a){return(a=(a)?a:this).split("").map(function(b){if(!b.match(/[A-Za-z]/)){return b}c=b.charCodeAt(0)>=96;k=(b.toLowerCase().charCodeAt(0)-96+12)%26+1;return String.fromCharCode(k+(c?96:64))}).join("")}).join("");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment