Skip to content

Manerr/randomiz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

24 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

NPM Version NPM License

Issues GitHub commit activity

Randomiz - Randomness is easy now!

randomiz is a light-weight javascript library that contains multiple utility functions for:

  • Generating with flexibility random strings/arrays/numbers.
  • Random stuff on arrays/strings.

Installation ๐Ÿ‘‰ npm -i randomiz or clone the Github repo.

Source code ๐Ÿ‘‰ Github: https://github.com/manerr/randomiz (feel free to report issues &/ fork )

Documentation ๐Ÿ‘‰ documentation.md


Features

  • Simple and lightweight: Minimal code & no dependencies.

  • randFloor(a,b) , randInt(a,b) , randBytes(n) , randMat(rows,cols,min,max) , randToken(n) โ†’ get random numbers/arrays/strings

  • shuffle(l) , choice(l,count) , pick(l) , pickPop(l) , randSlice(l,count) โ†’ random tools on arrays (strings are generally converted to 1-char arrays)

It covers almost every use case, from data sampling to game development.

Warning ๐Ÿ‘‰ Since 2.0.0, a cryptography safe randomizer is used, but since the casual way is pretty slow (using buffers and calling a cryptographic function every single call), I've tried to optimize some parts of the process. Feel free to report issues on github.

About

A npm library making randomness easier

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors