You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

26 regels
669 B

  1. var LessPass = require('../lib/index');
  2. var assert = require('assert');
  3. var site = 'lesspass.com';
  4. var login = 'contact@lesspass.com';
  5. var masterPassword = 'password';
  6. var options = {
  7. counter: 1,
  8. length: 12,
  9. lowercase: true,
  10. uppercase: true,
  11. numbers: true,
  12. symbols: true,
  13. template: 'vcVCns'
  14. };
  15. LessPass.encryptLogin(login, masterPassword)
  16. .then(encryptedLogin => {
  17. LessPass.renderPassword(encryptedLogin, site, options).then(generatedPassword => {
  18. assert.equal(generatedPassword, 'azYS7,olOL2]');
  19. console.log('generated password ok');
  20. });
  21. })
  22. .catch(e => {
  23. console.log(e);
  24. });