Dieses Repository beinhaltet HTML- und Javascript Code zur einer NotizenWebApp auf Basis von Web Storage. Zudem sind Mocha/Chai Tests im Browser enthalten. https://meinenotizen.netlify.app/
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.

index.js 468B

123456789101112131415161718
  1. "use strict";
  2. // Des module.
  3. const des = require('unix-crypt-td-js');
  4. // Hash generation string.
  5. const itoa64 = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  6. // Salt generation method.
  7. function getSalt() {
  8. return itoa64[ parseInt(Math.random() * 64) ] +
  9. itoa64[ parseInt(Math.random() * 64) ];
  10. }
  11. // Exporting old style.
  12. module.exports = (password, salt) => {
  13. return salt ? des(password, salt) : des(password, getSalt());
  14. };