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.


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


See the source for _.uid on GitHub.