Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

random-id

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

random-id

Generates a random String with options.

  • 0.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.2K
decreased by-1.66%
Maintainers
1
Weekly downloads
 
Created
Source

#randomID

Generates a customisable random ID, for node and browsers.

##Installation

Node

npm install random-id

Browsers

<script type="text/javascript" src="randomID.js"></script>

##Usage

//var randomID = require("random-id");

var id = randomID(length, strength);

##Options

  • length: (Number) The length of the random String, default: 30

  • strength: (Number) Amount of different characters collections to be used, default: 1

    • 1: [A-Z, a-z]
    • 2: [0-9]
    • 3: !§$%&/()=?-.,;:_#<>*+^°`´

##Examples

randomID(); 		//oOskDVlsS002iszDIcrWqdckY8aM8k
randomID(10); 		//JcWtjGmfNN

randomID(20,1);		//BInCYJaWjPnEEPcWiAVP
randomID(20,2);		//f4BeOaKyfNbVdoxIwO6e
randomID(20,3);		//XucMf6*!JO;R$;n<Z;6Y

Keywords

FAQs

Package last updated on 24 Jan 2014

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc