mlhaufe

rot13

Jun 21st, 2011
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function rot13(c){
  2.     return c.replace(/([a-m])|([n-z])/ig, function($0,$1,$2){
  3.        return $1 ? String.fromCharCode($1.charCodeAt(0) + 13) :
  4.               $2 ? String.fromCharCode($2.charCodeAt(0) - 13) : $0; });
  5. }
  6.  
  7. WScript.Echo(rot13('NOWHERE abjurer'))
Advertisement
Add Comment
Please, Sign In to add comment