"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateOtp = generateOtp;
const crypto_1 = require("crypto");
function generateOtp(length = 6, format = 'numeric') {
    if (format === 'numeric') {
        return Math.floor(10 ** (length - 1) + Math.random() * (10 ** length - 10 ** (length - 1) - 1)).toString();
    }
    else {
        return (0, crypto_1.randomBytes)(length).toString('hex').substring(0, length);
    }
}
//# sourceMappingURL=otp.js.map