guld-random

0.3.9 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i guld-random

Weekly Downloads

1

Version

0.3.9

License

MIT

Unpacked Size

7.77 kB

Total Files

7

Last publish

Collaborators

  • isysd