Skip to content

uid

Generate a unique identifier

280 bytes

Usage

Generates a unique string with optional special characters.

import * as
import _
_
from 'radashi'
import _
_
.
function uid(length: number, specials?: string): string
export uid

Generate a random string of a given length.

@seehttps://radashi.js.org/reference/random/uid

@example

uid(8)
// => "a3fSDf32"

@version12.1.0

uid
(7) // => UaOKdlW
import _
_
.
function uid(length: number, specials?: string): string
export uid

Generate a random string of a given length.

@seehttps://radashi.js.org/reference/random/uid

@example

uid(8)
// => "a3fSDf32"

@version12.1.0

uid
(12, '*') // => egFn*THGelM8

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.