@tanayshandilya/unique-id
TypeScript icon, indicating that this package has built-in type declarations

2.0.2 • Public • Published

Unique Id

Collection of few useful id functions.

How to install

npm i @tanayshandilya/unique-id
yarn add @tanayshandilya/unique-id

How to use

const { dateId, intId, base62Id } = require('unique-id');
const date_id = dateId(); // 20210306224063LEXJ9S
const int_id = intId(); // 39423541874 [default length: 12]
const b62_id = base62Id(); // x0SeEbRNcZRQ [default length: 12]

// or
import { dateId, intId, base62Id } from '@tanayshandilya/unique-id';
const date_id = dateId(); // 20210306224063LEXJ9S
const int_id = intId(); // 39423541874 [default length: 12]
const b62_id = base62Id(); // x0SeEbRNcZRQ [default length: 12]

// using minified mode for dateId
const id = dateId(true); // 2KUFLTFLAHTKN4MD 

Id components

DateId

YYYY-MM-DD-HH-MM-{BASE36}
2021-03-06-22-40-63LEXJ9S

IntId

{0-9}(length)
39423541874

Base62Id

{0-9 a-z A-Z}(length)
x0SeEbRNcZRQ

Package Sidebar

Install

npm i @tanayshandilya/unique-id

Weekly Downloads

2

Version

2.0.2

License

MIT

Unpacked Size

5.16 kB

Total Files

7

Last publish

Collaborators

  • tanayshandilya