UNPKG

@openinc/parse-server-opendash

Version:
18 lines (17 loc) 570 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createRandomPassword = createRandomPassword; /** * Creates a random password of length 32 characters. * * @returns A random password of length 32 characters. */ async function createRandomPassword() { const length = 32; const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; let password = ""; for (let i = 0; i < length; i++) { password += charset.charAt(Math.floor(Math.random() * charset.length)); } return password; }