* Generate a random password: 14 chars, mix of uppercase, lowercase, digits, symbols.
()
| 1202 | * Generate a random password: 14 chars, mix of uppercase, lowercase, digits, symbols. |
| 1203 | */ |
| 1204 | function generatePassword() { |
| 1205 | const upper = 'ABCDEFGHJKLMNPQRSTUVWXYZ'; |
| 1206 | const lower = 'abcdefghjkmnpqrstuvwxyz'; |
| 1207 | const digits = '23456789'; |
| 1208 | const symbols = '!@#$%&*?'; |
| 1209 | const all = upper + lower + digits + symbols; |
| 1210 | |
| 1211 | // Ensure at least one of each type |
| 1212 | let pw = ''; |
| 1213 | pw += upper[Math.floor(Math.random() * upper.length)]; |
| 1214 | pw += lower[Math.floor(Math.random() * lower.length)]; |
| 1215 | pw += digits[Math.floor(Math.random() * digits.length)]; |
| 1216 | pw += symbols[Math.floor(Math.random() * symbols.length)]; |
| 1217 | |
| 1218 | // Fill remaining 10 chars |
| 1219 | for (let i = 0; i < 10; i++) { |
| 1220 | pw += all[Math.floor(Math.random() * all.length)]; |
| 1221 | } |
| 1222 | |
| 1223 | // Shuffle |
| 1224 | return pw.split('').sort(() => Math.random() - 0.5).join(''); |
| 1225 | } |
| 1226 | |
| 1227 | function normalizeHotmailAccount(account = {}) { |
| 1228 | const normalizedLastAuthAt = Number.isFinite(Number(account.lastAuthAt)) ? Number(account.lastAuthAt) : 0; |