MCPcopy
hub / github.com/Peppermint-Lab/peppermint / generateRandomPassword

Function generateRandomPassword

apps/api/src/controllers/auth.ts:39–48  ·  view source on GitHub ↗
(length: number)

Source from the content-addressed store, hash-verified

37}
38
39function generateRandomPassword(length: number): string {
40 const charset =
41 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+";
42 let password = "";
43 for (let i = 0; i < length; i++) {
44 const randomIndex = Math.floor(Math.random() * charset.length);
45 password += charset[randomIndex];
46 }
47 return password;
48}
49
50async function tracking(event: string, properties: any) {
51 const client = track();

Callers 1

authRoutesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected