Generate a unique identifier
Generates a unique string with optional special characters.
import * as import __ from 'radashi' import __.function uid(length: number, specials?: string): stringexport uidGenerate a random string of a given length.@see ― https://radashi.js.org/reference/random/uid@example uid(8)// => "a3fSDf32"@version ― 12.1.0uid(7) // => UaOKdlWimport __.function uid(length: number, specials?: string): stringexport uidGenerate a random string of a given length.@see ― https://radashi.js.org/reference/random/uid@example uid(8)// => "a3fSDf32"@version ― 12.1.0uid(12, '*') // => egFn*THGelM8
import _
function uid(length: number, specials?: string): stringexport uid
Generate a random string of a given length.
@see ― https://radashi.js.org/reference/random/uid
@example uid(8)// => "a3fSDf32"
uid(8)// => "a3fSDf32"
@version ― 12.1.0
Note, this function is optimized for simplicity and usability — not performance or security. If you need to create universally unique or cryptographically random strings use a package specifically for that purpose.