Skip to content

ecrmnn/arand

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

arand

Generate an almost random number of a given length

Travis npm version npm downloads npm license

Installation

npm install arand --save

What?

Almost random? What kind of sorcery is this?

arand(length, x) generates a random number of a given length where at least x of the digits are the same. This generates numbers that are easy to remember and type. arand() is perfect when generating codes used for two way authentication.

Usage

const arand = require('arand');

arand(3, 2);
//=> 808

arand(4, 2);
//=> 6768

arand(4, 2);
//=> 9993

arand(6, 4);
//=> 242227

License

MIT © Daniel Eckermann

Releases

No releases published

Packages

No packages published