Skip to content

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

License

Notifications You must be signed in to change notification settings

NicolasKlenert/csrng

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

csrng

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

Installation

  npm install csrng --save

Usage

  var gen = require('csrng');

  //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

Noteworthy Release History

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

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published