README
smart-id
Generate random string for you.
Installation
npm install smart-id
Get started
var smartId = require("smart-id");
var id = smartId.make(); // will make a random string like: mYcAEQExvm
Api
smartId.make(mode, length)
mode
is a string, it can be:
a
stands for use only lowercase charactersa-z
.A
stands for use only uppercase charactersA-Z
.0
stands for use only numbers0-9
._
stands for add_
to candidate characters, can take more than one like$%^&*_
.- all before can be used at the same time, like
aA0_
means the candidate isa-z
,A-Z
,0-9
and_
. s
is special, it stands for smart mode, this will trim confused characters like0
,o
andO
.
- default mode is
aA0
. - default length is
10
.