csrng

0.1.1 • Public • Published

csrng

(C)riptographically (S)ecure (R)andom (N)umber (G)enerator

Installation

  npm install csnrg --save

Usage

  var gen = require('csnrg');

  //output a number (as string) with base 16 and a length of 10
  gen.setOutputSettings(16,10);
  //default is 64,11

  //define your own digits
  gen.setIndex("abcdefghiklmoprstuwxz");
  //default is 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-

  var numberString = gen.create();

  console.log(numberString);

Tests

   npm test

Features

  • Especially good to create some id's for human readability
  • Can create numbers which are a lot bigger than the usual cap
  • Define your own digits and the hierarchy of them

Release History

  • 0.1.1 Added tests and corrected a calculation
  • 0.1.0 Initial release

Readme

Keywords

Package Sidebar

Install

npm i csrng

Weekly Downloads

1

Version

0.1.1

License

MIT

Last publish

Collaborators

  • nicoklenert