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

iso-random

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

iso-random

Cryptographically secure random number generator using `/dev/urandom` with fallback to node's `crypto` and finally to `window.crypto || window.mscrypto`.

latest
Source
npmnpm
Version
0.4.0
Version published
Maintainers
1
Created
Source

random

Cryptographically secure random number generator using /dev/urandom with fallback to node's crypto and finally to window.crypto || window.mscrypto.

Usage

// get random buffer of length 100
var buff = await randBuffer(100)

// get random, alphanumeric (default) string of length 100
var str = await randStr(100)

// get random, alphanumeric + special string of length 100
var str = await randStr(100, 'all')

// get random number less than or equal to 100
var num = await randInt(100)

// get random timestamp from within range of unix timestamps (seconds)
var time = randTimestamp(date.now()/1000 - 10000, date.now()/1000)
Node
import { haystack, randBuffer, randStr, randInt } from '../random/random.js'

License

MIT Copyright isysd

Keywords

isomorphic

FAQs

Package last updated on 21 Sep 2020

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