UID Generator
A small package for generating cryptographically secure UIDs in the browser, safe for both cookie and URL usage.
This package is a mirror of uid-safe, but meant to be used in a browser env.
Additionally, it comes bundled with TypeScript typings.
Table of Contents
Installation
You can install this package from NPM:
npm add crypto-uid
Or with Yarn:
yarn add crypto-uid
NOTE: For non ES6 users, you need to make sure that tslib is available.
Usage
Generate a random UID:
import uid from 'crypto-uid';
const id = uid(6);
Browser Support
You can expect this lib to run wherever Web Crypto API is supported.
Contribute
If you wish to contribute, please use the following guidelines: