- Notifications
You must be signed in to change notification settings - Fork1
Scrambles email addresses and phone numbers with ROT-18 to hide them from bots
License
thibaudcolas/email-scramble
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Encode/decode email addresses and phone numbers with ROT-18 to hide them from bots. Can be used server-side with Node.js or in a browser.
If you'd like to know more about obfuscation techniques and their success ratio,here is a great blog post on the subject.
email-scramble
uses a simpleROT transformation. The default rotation is ROT-18: letters will be rotated by 13 and numbers by 5.
varencodedEmail=emailScramble.encode("mail@example.com");vardecodedMail=emailScramble.decode(encodedMail);// You can also pick any other flavor of ROT:functionmyROT(str){// Here letters are obfuscated with ROT-13 and numbers are kept clear.returnemailScramble.rot(13,0,str);}// Functional-programming partial application style:varmyRot=emailScramble.rot.bind(emailScramble,13,0);
Here is a real-world example:
// <a href="znvygb:znvy@rknzcyr.pbz" data-email-scramble>Send me an email!</a>varlinks=document.querySelectorAll("[data-email-scramble]");links.forEach(functiondecodeLink(link){link.href=emailScramble.decode(link.href);});
npm install --save email-scramble
// ES6+importemailScramblefrom"email-scramble";// The CommonJS way.varemailScramble=require("email-scramble");
About
Scrambles email addresses and phone numbers with ROT-18 to hide them from bots
Topics
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.