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

randomr

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

randomr

easily generate random strings

latest
Source
npmnpm
Version
4.0.3
Version published
Weekly downloads
28
-6.67%
Maintainers
1
Weekly downloads
 
Created
Source

randomr Build Status js-standard-style

Easily generate random strings of any length

Usage

Installation:

Use yarn or npm:

$ [sudo] npm install randomr --save

Sync API:

var randomr = require('randomr')

randomr(size, type) defaults: 32, "hex"

Size in bytes, type (optional): e.g. hex or base64

randomr(8, 'hex') // => 'c7184ef1'
randomr(4096) // => '0wZTkZdVyenwd3uPq8mCidkSjxb0Qz0EtQUengt.....'

Async API:

Returns a Promise with a single string result value.

var randomr = require('randomr/async')

randomr(8)
  .then((result) => result) // => 'c7184ef1'

randomr(4096, 'base64')
  .then((result) => result) // => '0wZTkZdVyenwd3uPq8mCidkSjxb0Qz0EtQUengt.....'

Keywords

random

FAQs

Package last updated on 22 Jan 2017

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