Socket
Socket
Sign inDemoInstall

random-chars

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    random-chars

A small JavaScript library for generating random symbols


Version published
Weekly downloads
1
Maintainers
1
Install size
7.26 kB
Created
Weekly downloads
 

Readme

Source

random-chars

A small JavaScript library for generating random symbols

  • All browsers are supported
  • No dependencies

Installation

<script src="/path/to/random-chars.js"></script>

npm

npm i random-chars --save

var randomChars = require('random-chars');

Usage

randomChars.get();
/* Result: 95ejI8y5TPG8gR5c */

randomChars.get(3); //lenght (default: 16)
/* Result: zVx */

randomChars.get(16, 'haha'); //lenght and custom chars
/* Result: aaaaaaahhhhahahh */

randomChars.get({
  amount: 3 //lenght (default: 16)
});
/* Result: uIE */

randomChars.get({
  chars: 'haha' //custom chars (default: _defaultChars)
});
/* Result: ahaaahahhaaaaaha */

randomChars.get({
  amount: 36, //lenght (default: 16)
  use: {
    digits: false //digits from default chars (default: true)
  }
});
/* Result: NqJTlKgoWeWSwGiNGfqstJqyOLiscrXpjsDh */

randomChars.get({
  amount: 36, //lenght (default: 16)
  use: {
    lower: false //lowercase letters from default chars (default: true)
  }
});
/* Result: RMHGNDC3EO1CQYFH9MAYO52U3NYH2KUTPHMT */

randomChars.get({
  amount: 36, //lenght (default: 16)
  use: {
    upper: false //uppercase letters from default chars (default: true)
  }
});
/* Result: mnroj1095flbyplmh4fo6r5p4tpbbbt1mdt4 */

Keywords

FAQs

Last updated on 24 Mar 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc