"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.createTemporaryPassword = void 0;
const humanhash_1 = __importDefault(require("humanhash"));
const uuid_1 = require("./uuid");
const logging_1 = require("../logging");
const hh = new humanhash_1.default();
const randomNumber = () => Math.round(Math.random() * 100).toString(10);
const createTemporaryPassword = () => {
    const partOne = hh.humanize((0, uuid_1.uuid)()).split('---').join('-');
    const partTwo = hh.humanize((0, uuid_1.uuid)()).split('---').join('-').toUpperCase();
    const temporaryPassword = `${partOne}-!-${partTwo}-${randomNumber()}`;
    let password = temporaryPassword;
    while (password.length < 12) {
        password += randomNumber();
    }
    logging_1.logger.info(`createTemporaryPassword generated: ${password}`);
    return password;
};
exports.createTemporaryPassword = createTemporaryPassword;
//# sourceMappingURL=passwords.js.map