Skip to content

Create a random id of any length with characters 0-9,A-Z,a-z using the browser's crypto.getRandomValues interface.

Notifications You must be signed in to change notification settings

dabblewriter/crypto-id

Repository files navigation

Crypto ID

Create random alphanumeric IDs of any length using the browser crypto API.

Installation

npm install crypto-id

Usage

The number of ids possible is 62^n where n is the length of the string.

import { createId } from 'crypto-id';

createId(); // RJPoz4veOGn9nbDILhmfga3n (length 24 by default) 1.040879722e43 possible ids
createId(12); // GS7rPnA0mmbv (3.226266762e21 possible ids)
createId(4); // vMH6 (14,776,336 possible ids)

About

Create a random id of any length with characters 0-9,A-Z,a-z using the browser's crypto.getRandomValues interface.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published