@starefossen/rand-path
v2.1.0
Published
Dead simple random path generator
Downloads
178
Maintainers
Readme
@starefossen/rand-path
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.