Last active
May 28, 2018 20:18
-
-
Save peteee/1790dba33480c9a4b87b9292d05a7ee8 to your computer and use it in GitHub Desktop.
Replace a mailto:email addr. -link with this handy lil snippet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ROT13 Email Decrypter | |
* -TextMate-style- | |
* | |
* Creates a mailto: -Email link | |
* Hides Email addresses from spam bots | |
* Format: [email protected]: [email protected] | |
* | |
* @author Peter Oberlaender | |
*/ | |
var emailName = "grfg", | |
emailDomain = "grfg", | |
emailTld = "pbz"; | |
var myRot13Hash = "<n uers=\"znvygb:"+emailName+"\100"+emailDomain+"\056"+emailTld+"\">"+emailName+"\100"+emailDomain+"\056"+emailTld+"<\057n>"; | |
document.write(myRot13Hash.replace(/[a-zA-Z]/g, function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment