node-acid-id
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

🐢node-acid-id🚀

Acid-ID generator for Node.js

📜Introduction

"What's Acid-ID?" - Acid-ID is a unique id based on time the id is generated.
Suppose, I generate Acid-ID at 18:43 GMT+0700 at 22 January 2022, the id will be like:
7rndm114305rndm220122
"What does that actually mean?" - Let's find out!

Quick note before starting: rndm is 4 random digit in the real Acid-ID so we should'nt have to explain. (Don't worry, they're generated with crypto.randomInt() so it's really random)

#1: '7'

'7' is the day, I generate the id on Saturday. Oh and yeah, Sunday is the first day of the week.

#2: '114305'

'114305' is the time (in hh:mm:ss format), yes I generate it on 18:43 my local timezone.

Oops, forgot to mention that Acid-ID use UTC/GMT time, not your local time.

#3: '220122'

Bet you know what is it. Yes it's the date (in ddmmyy format).

🚀Usage

Use in JavaScript

const id = require('node-acid-id');
const gen = new id.generation()
const acidId = gen.returnID() // Do things with the id :)

or in TypeScript

import * as id from 'node-acid-id'
const gen = new id.generation()
const acidId: string = gen.returnID() // Do things with the id :)

📄License

Acid-ID, and it's generator is MIT-licensed.

Dependencies (0)

    Dev Dependencies (2)

    Package Sidebar

    Install

    npm i node-acid-id

    Weekly Downloads

    2

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    8.9 kB

    Total Files

    6

    Last publish

    Collaborators

    • hifzonmursalin