Skip to content
creates email verification token for an email address.
JavaScript
Find file
Latest commit aa91952 @alfredwesterveld Merge pull request #2 from rypalmer/patch-1
Fix json parsing error in npm.
Failed to load latest commit information.
examples modified .gitignore to ignore expresso coverage files
lib first commit
test cleaned up code
.gitignore modified .gitignore to ignore expresso coverage files
.npmignore first commit
Makefile
README.md Fixed a typo in the README.
package.json Fix json parsing error in npm.

README.md

Requirements

  1. node.js is installed the correct way. Read next item to accomplish this.
  2. npm is installed the correct way.

Installation

npm install email-verificationtoken

Example

An email address needs to be encrypted to create an email verification token. In this example alfredwesterveld@gmail.com is getting encrypted using KEY = 123. This key needs to be updated to create a different(your) email verification token.

// To create secret token for email adress.
var email = require('email-verificationtoken');
var KEY = '123'; // Needs to be updated.
var EMAIL_TO_ENCRYPT = 'alfredwesterveld@gmail.com'; // Email to encrypt.
var encryptEmail = email.create(KEY);
var encrypted = encryptEmail.encrypt(EMAIL_TO_ENCRYPT); 
var decrypted = encryptEmail.decrypt(encrypted);
console.log(encrypted); // 1fb70bd0756ac12c496bcdd4b48586b027b89164850af100e0d50e80103cf367
console.log(decrypted); // alfredwesterveld@gmail.com
Something went wrong with that request. Please try again.