Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var User = function() {
  2.   this.name = "Смоук";
  3.   this.surname = "Тест";
  4.   this.password = 123456;
  5.  
  6.   Object.defineProperty(this, "email", {
  7.     get: function() {
  8.       var hash = "user-";
  9.       var domain = "@mail.com";
  10.       var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  11.       for( var i=0; i < 10; i++ )
  12.         hash += possible.charAt(Math.floor(Math.random() * possible.length));
  13.  
  14.       return hash + domain;
  15.     }
  16.   })
  17. };
  18.  
  19. module.exports = User;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement