const bcrypt = require('bcryptjs');

async function generateHash() {
  const password = 'admin123';
  const hash = await bcrypt.hash(password, 12);
  console.log('Password:', password);
  console.log('Hash:', hash);
  
  // 验证哈希
  const isValid = await bcrypt.compare(password, hash);
  console.log('验证结果:', isValid);
}

generateHash().catch(console.error);