UNPKG

@topgroup/diginext

Version:

A BUILD SERVER & CLI to deploy apps to any Kubernetes clusters.

19 lines (18 loc) 724 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.generateRandomString = void 0; /** * Generates a random string of the specified length using only digits and alphabet characters. * @param length - The length of the random string to generate. * @returns A random string of the specified length. */ function generateRandomString(length) { const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; let result = ""; for (let i = 0; i < length; i++) { const randomIndex = Math.floor(Math.random() * characters.length); result += characters[randomIndex]; } return result; } exports.generateRandomString = generateRandomString;