1.1.3 • Published 3 years ago

@daanila01/smallid v1.1.3

Weekly downloads
2
License
MIT
Repository
-
Last release
3 years ago

Smallid

Generate uniq id different length

Installation

npm i @daanila/smallid

Usage

const smallid = require('@daanila01/smallid')

const sid = new smallid()

// length id 5
sid.generate(5) // GW6cn

// length id 12
sid.generate() // ZDzo5Xmr97Cn

// is valid id
sid.isValid('ZDzo5Xmr97Cn') // true
sid.isValid('!SAdsg01') // false

// custom alphabet
sid.customAlphabet('123456789!@') // 7!98135264@

// use custom alphabet
sid.customAlphabet('123456789!@') // 7!98135264@
sid.generate() // 6999@69@6116
sid.isValid('6999@69@6116') // true

License

MIT License

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago