Basic usage

Generates a unique string with optional special characters.

import { uid } from 'radash'

uid(7) // => UaOKdlW
uid(20, '*') // => dyJdbC*NsEgcnGjTHS

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.

Testing

This _.uid function is 100% covered by tests. See them and contribute at GitHub.

Source

See the source for _.uid on GitHub.