Parolning yaxlitligini
himoyalovchi dasturiy
ta’minot moduli
Parolning yaxlitligini
himoyalovchi dasturiy
ta’minot moduli
Bcrypt.js: Bu modul parollarni xavfsiz tarzda
saqlash va tekshirish uchun foydalaniladi.
npm install bcryptjs
const bcrypt = require(‘bcryptjs’);
const userPassword = ‘mypassword’;
bcrypt.genSalt(10, (err, salt) => {
bcrypt.hash(userPassword, salt, (err, hash)
=> {
if (err) throw err;
// Hashni saqlash yoki bazaga yozish
uchun ishlatish
console.log(‘Hashed Password:’, hash);
});
});
Bcrypt.js: Bu modul parollarni xavfsiz tarzda
saqlash va tekshirish uchun foydalaniladi.
npm install bcryptjs
const bcrypt = require(‘bcryptjs’);
const userPassword = ‘mypassword’;
bcrypt.genSalt(10, (err, salt) => {
bcrypt.hash(userPassword, salt, (err, hash)
=> {
if (err) throw err;
// Hashni saqlash yoki bazaga yozish
uchun ishlatish
console.log(‘Hashed Password:’, hash);
});
});