🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

crypto-id

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crypto-id

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

0.2.3
latest
Source
npm
Version published
Maintainers
1
Created
Source

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)

Keywords

random

FAQs

Package last updated on 04 Mar 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts