@starefossen/rand-path

2.1.0 • Public • Published

@starefossen/rand-path

Build status Codacy grade Codacy coverage NPM downloads NPM version Node version Dependency status

Dead simple random path generator.

Install

npm install @starefossen/rand-path --save

Usage

> var randPath = require('@starefossen/rand-path');
> randPath()
'wr/TB/s6'
> randPath(4)
'3J/P3/8K/y6'
> randPath(10, 3)
'6Szt/skob/vvay/ul23/6ceF/iX3O/ngU8/jKQU'

Test

npm test

Collision Probability

With the default alphabet of 62 characters, this random path generator has a 62^2n (where n is the depth of path) probability for a collision. With the default depth of 3 that is 1 in 56,800,235,584 chance.

MIT Licensed

Package Sidebar

Install

npm i @starefossen/rand-path

Weekly Downloads

19

Version

2.1.0

License

MIT

Last publish

Collaborators

  • starefossen