New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@vs-org/random

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vs-org/random

This is simple random string generator utility

latest
npmnpm
Version
0.0.6
Version published
Maintainers
1
Created
Source

VS Random

This is simple random character generator utility

Usage

  • Generate random numbers
   const random = required("@vs/random");
   const randomNumbers = random({ length: 6, type: "numbers" });

   output: "063367"

  • Generate random string with upper case alphabet
   const random = required("@vs/random");
   const randomString = random({ length: 6, type: "uppercase" });

   output: "PJIBBA"
  • Generate random string with lower case alphabet
   const random = required("@vs/random");
   const randomString = random({ length: 6, type: "lowercase" });

   output: "ochdid"
  • Generate random string with default random charset
   const random = required("@vs/random");
   const randomString = random({ length: 6, type: "random" });

   output: "RCIhj/"
  • Generate random string with custom charset
   const random = required("@vs/random");
   const randomString = random({ length: 6, charset: "ABCDuifj987)(.:" });

   output: "jC8(i8"

Options

optionDescription
type: numbersGenerate random number, but returns as string
type: uppercaseGenerate randomg string with only upper case alphabet
type: lowercaseGenearte random string with only lowercase alphabet
type: symbolsGenerate random stgring with only symbols (from default charset)
type: randomGenerate random string with all above values (depends on length of string to include all chars). It does not mean it will atleast include one char from above options
charset: {custom char set}Generates random string from custom, note if charset is provided it takes priority over above options charset
length: {length of random string}Generates random string with above options of this length

License

MIT (see LICENSE)

Keywords

Random generator

FAQs

Package last updated on 30 Aug 2022

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