Skip to content

a library for generating random strings and numbers through sampling

License

Notifications You must be signed in to change notification settings

thatrandybrown/dimitri

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dimitri

a library for generating random strings and numbers through sampling

Overview

dimitri is a small library for generating random numbers and strings in node applications that places security over success.

Two things to note:

  • dimitri will throw an error if a window is defined
  • dimitri will not generate numbers greater than 2^32

Installation

npm i dimitri

Usage

Generating a Random Number

const csprng = require('dimitri').getRandInRange

console.log(csprng(5, 10)) // min, max
// 8, maybe

Generating a Random String

const dimitri = require('dimitri')

const genStringOfLen = dimitri.getString("abcdefghijklmnopqrstuvwxyz") // valid chars

console.log(genStringOfLen(5)) // desired length
// bkmod, maybe

About

a library for generating random strings and numbers through sampling

Resources

License

Stars

Watchers

Forks

Packages

No packages published