guld-random

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


Keywords
guld, fs, node, browser
License
MIT
Install
npm install guld-random@0.3.9

Documentation

guld-random

source issues documentation

node package manager travis-ci lgtm david-dm david-dm

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

Install

Node
npm i guld-random
Browser
curl https///bitbucket.org/guld/tech-js-node_modules-guld-random/raw/guld/guld-random.min.js -o guld-random.min.js

Usage

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

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

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

// get random number less than or equal to 100
var num = await getRandInt(100)
Node
const { getHaystack, getRandBuffer, getRandStr, getRandInt } = require('guld-random')

License

MIT Copyright isysd