Files
EmployeeManagementSystem/backend/scripts/hash-password.js
2025-11-27 22:50:08 +00:00

14 lines
366 B
JavaScript

import bcrypt from 'bcryptjs';
const password = process.argv[2] || 'admin123';
bcrypt.hash(password, 10, (err, hash) => {
if (err) {
console.error('Error hashing password:', err);
process.exit(1);
}
console.log('Password:', password);
console.log('Hash:', hash);
console.log('\nUse this hash in the database schema or when creating users.');
});