@openinc/parse-server-opendash
Version:
Parse Server Cloud Code for open.INC Stack.
18 lines (17 loc) • 570 B
JavaScript
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;
}
;