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.
 
 
 
 
 
 

54 regels
1.3 KiB

  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. </head>
  6. <body>
  7. <script src="../dist/lesspass.min.js"></script>
  8. <script>
  9. function displayInBody(txt) {
  10. document.body.innerHTML = document.body.innerHTML + txt + '<br>';
  11. }
  12. function displayErrorInBody(txt) {
  13. document.body.innerHTML = document.body.innerHTML + '<span style="color:red;">' + txt + '</span><br>';
  14. }
  15. </script>
  16. <script>
  17. displayInBody("createFingerprint :");
  18. displayInBody("e56a207acd1e6714735487c199c6f095844b7cc8e5971d86c003a7b6f36ef51e");
  19. try {
  20. LessPass.createFingerprint('password').then(fingerprint => {
  21. displayInBody(fingerprint + " (generated)")
  22. });
  23. }
  24. catch (err) {
  25. displayErrorInBody(err.message);
  26. }
  27. </script>
  28. <script>
  29. const site = 'example.org';
  30. const login = 'contact@example.org';
  31. const masterPassword = 'password';
  32. const passwordProfile = {
  33. lowercase: true,
  34. uppercase: true,
  35. numbers: true,
  36. symbols: true,
  37. length: 16,
  38. counter: 1,
  39. version: 2
  40. };
  41. displayInBody("<br>generatePassword :");
  42. displayInBody("WHLpUL)e00[iHR+w");
  43. try {
  44. LessPass.generatePassword(site, login, masterPassword, passwordProfile).then(function(generatedPassword) {
  45. displayInBody(generatedPassword + " (generated)")
  46. });
  47. }
  48. catch (err) {
  49. displayErrorInBody(err.message);
  50. }
  51. </script>
  52. </body>
  53. </html>