Friday, June 12, 2009

Handy rot-13 bookmarklet

Picked this up at Making Light some years back.

javascript:inText=window.getSelection()+'';if(inText=='')%7Bvoid(inText=prompt('Phrase...','')) %7D;if(!inText)%7BoutText='No%20text%20selected'%7Delse%7BoutText='';for(i=0;i%3CinText.length;i++) %7Bt=inText.charCodeAt(i);if((t%3E64&&t%3C78)%7C%7C(t%3E96&&t%3C110))%7Bt+=13%7Delse%7Bif ((t%3E77&&t%3C91)%7C%7C(t%3E109&&t%3C123))%7Bt-=13%7D%7DoutText+=String.fromCharCode(t)%7D%7Dalert(outText)

That's all one line.

Make a new bookmark and paste that in for the location. When you come across rot-13 text, select it, then click the bookmark. The decoded text shows up in one of those little javascript boxes. Try it on this: "Qevax hc, rirelobql. Gb gur arj cnegare naq gur byq barf. Jr fvzcyl unir gb trg n fxvashy gb fgnaq gung Xvnevna yhapurba." And of course it works the other way round, as well.

1 comment:

Anonymous said...

Ich tue Abbitte, dass sich eingemischt hat... Ich finde mich dieser Frage zurecht. Ist fertig, zu helfen. cialis cialis generika aus deutschland [url=http//t7-isis.org]levitra vs viagra forum[/url]