0.1.4 • Published 7 months ago

dimitri v0.1.4

Weekly downloads
9
License
MIT
Repository
github
Last release
7 months ago

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
0.1.4

7 months ago

0.1.3

7 months ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago