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.

README.md 1.8 KiB

8 years ago
8 years ago
8 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # LessPass core
  2. npm core library used to generate LessPass passwords
  3. ## Requirements
  4. - node LTS v6
  5. ## Install
  6. npm install lesspass
  7. ## Usage
  8. var profile = {
  9. site: 'example.org',
  10. login: 'contact@example.org'
  11. }
  12. var masterPassword = 'password';
  13. LessPass.generatePassword(profile, masterPassword)
  14. .then(function (generatedPassword) {
  15. console.log(generatedPassword); // WHLpUL)e00[iHR+w
  16. });
  17. see [tests/api.tests.js](tests/v2/api.tests.js) for more examples
  18. ## API
  19. ### generatePassword(profile, masterPassword)
  20. generate LessPass password
  21. var profile = {
  22. site: 'example.org',
  23. login: 'contact@example.org'
  24. options: {
  25. uppercase: true,
  26. lowercase: true,
  27. digits: true,
  28. symbols: true,
  29. length: 16,
  30. counter: 1
  31. },
  32. crypto: {
  33. method: 'pbkdf2',
  34. iterations: 100000,
  35. keylen: 32,
  36. digest: "sha256"
  37. }
  38. };
  39. var masterPassword = 'password';
  40. LessPass.generatePassword(profile, masterPassword)
  41. .then(function (generatedPassword) {
  42. console.log(generatedPassword); // WHLpUL)e00[iHR+w
  43. });
  44. ### createFingerprint(password)
  45. create a fingerprint
  46. LessPass.createFingerprint('password').then(fingerprint => {
  47. console.log(fingerprint); //e56a207acd1e6714735487c199c6f095844b7cc8e5971d86c003a7b6f36ef51e
  48. });
  49. ### isSupported()
  50. test if LessPass is supported
  51. LessPass.isSupported().then(function(isSupported) {
  52. if (isSupported) {
  53. console.log("LessPass is supported");
  54. }
  55. else {
  56. console.log("LessPass is not supported");
  57. }
  58. });
  59. ## Tests
  60. npm test
  61. ## License
  62. This project is licensed under the terms of the GNU GPLv3.
  63. ## Issues
  64. report issues on [LessPass project](https://github.com/lesspass/lesspass/issues)