Strings

All string utilities vuub provides.

generateRandomId()

Description: Generates a random string using all of the characters from the English alphabet (both lowercase and uppercase) as well as numbers (0-9). The ID generated will be different each time the function is executed. There is also no pattern in which the IDs get picked, so it is truly random. Parameters: generateRandomId(desired_length) Output Type: String Code Snippet:

const { generateRandomId, generateRandomIdAsync } = require('vuub')

function SynchronousUsage () {

    var randomId = generateRandomId(7)
    console.log(randomId) // Output: hsIal8h

}

async function AsynchronousUsage () {
    
    var randomId = await generateRandomIdAsync(4)
    console.log(randomId) // Output: jK8A
    
}

Last updated