package
generates a cryptographically strong random uid
npm install uid-promiseGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Creates a cryptographically secure UID with a 62 character range that can be safely used in URLs.
Install the package:
npm i uid-promiseThen import it:
import { uid } = from 'uid-promise';Finally, call it:
await uid(20);uid(Number len) => Promise
Promise that resolves with a string of random characters
of length lenlen must always be provided, else the promise is rejectedcrypto.randomBytes is usedABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789Estimated unpacked size across 1 packages.
7.7 kB
Includes dependencies.
zeit-bot
team@zeit.co