@daanila01/smallid

1.1.3 • Public • Published

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

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @daanila01/smallid

      Weekly Downloads

      8

      Version

      1.1.3

      License

      MIT

      Unpacked Size

      1.94 kB

      Total Files

      3

      Last publish

      Collaborators

      • daanila01