Skip to content

Instantly share code, notes, and snippets.

@cowboy
Created July 27, 2010 14:37
Show Gist options
  • Select an option

  • Save cowboy/492307 to your computer and use it in GitHub Desktop.

Select an option

Save cowboy/492307 to your computer and use it in GitHub Desktop.
ROT13
// "Maximum encryption"
function rot13( str ) {
return ( str || '' ).replace( /[a-z]/ig, function(a){
var n = a.charCodeAt(0);
return String.fromCharCode(n>109||n<97&&n>77?n-13:n+13);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment