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.
 
 
 
 
 
 

25 lines
645 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. };
  14. LessPass.encryptLogin(login, masterPassword)
  15. .then(encryptedLogin => {
  16. LessPass.renderPassword(encryptedLogin, site, options).then(generatedPassword => {
  17. assert.equal(generatedPassword, 'azYS7,olOL2]');
  18. console.log('generated password ok');
  19. });
  20. })
  21. .catch(e => {
  22. console.log(e);
  23. });