2.1.0 • Published 8 years ago

@starefossen/rand-path v2.1.0

Weekly downloads
17
License
MIT
Repository
github
Last release
8 years ago

@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