@darkwolf/pushid

1.0.9 • Public • Published

PushID

Install

npm i --save @darkwolf/pushid

Usage

// ECMAScript
import PushID from '@darkwolf/pushid'
// CommonJS
const PushID = require('@darkwolf/pushid')

const generator = PushID.generator() // base64url encoding
generator.next() // => IteratorResult
const base62Generator = PushID.generator('base62')
base62Generator.next() // => IteratorResult
const base58Generator = PushID.generator('base58')
base58Generator.next() // => IteratorResult

const pushId = new PushID() // base64url encoding
pushId.timestamp // => null
const uid = pushId.generate() // => '-M_aLVkfh_UAGfe7mllM'
pushId.timestamp // => 1620919847979
PushID.decodeTimestamp(uid) // => 1620919847979
const base62PushId = new PushID('base62')
base62PushId.generate() // => '0SXJ0UdqW0bem6JGClMA'
const base58PushId = new PushID('base58')
base58PushId.generate() // => '1jaa8uoknTqzpegwD4WC'

API Documentation

Contact Me

GitHub: @PavelWolfDark

Telegram: @PavelWolfDark

Email: PavelWolfDark@gmail.com

Readme

Keywords

Package Sidebar

Install

npm i @darkwolf/pushid

Weekly Downloads

10

Version

1.0.9

License

MIT

Unpacked Size

17.9 kB

Total Files

6

Last publish

Collaborators

  • pavelwolfdark