import { Injectable } from '@angular/core'; @Injectable({ providedIn: 'root' }) export class PasswordGeneratorService { constructor() { } generateStrongPassword() { const lowercaseChars = 'abcdefghijklmnopqrstuvwxyz'; const uppercaseChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; const numberChars = '0123456789'; const symbolChars = '!@#$%^&*()_+~`|}{[]:;?><,./-='; const allChars = lowercaseChars + uppercaseChars + numberChars + symbolChars; const chars: string[] = new Array(12).fill(0).map(() => allChars[Math.floor(Math.random() * allChars.length)]); return chars.join(''); } generateSimplePassword() { return Math.random().toString(36).slice(2, 12); } }