@cedric0303/id-generator

0.2.1 • Public • Published

@cedric0303/id-generator

Installation

Install globally to use sgid or hkid:

npm install --global @cedric0303/id-generator

yarn global add @cedric0303/id-generator

bun add --global @cedric0303/id-generator

Install locally to use in projects:

npm install @cedric0303/id-generator

yarn add @cedric0303/id-generator

bun add @cedric0303/id-generator

Global Usage

> sgid
A5758052

> hkid
S8541816E

// output automatically copied to clipboard

See sgid --help or hkid --help for more details

Module/Programmatic Usage

@cedric0303/id-generator can be imported as a module:

import {
  randomHKID,
  randomSGID,
  isValidHKID,
  isValidSGID
} from "@cedric0303/id-generator";

const hkid = await randomHKID();
const sgid = await randomSGID();

console.log(hkid, isValidHKID(hkid));
console.log(sgid, isValidSGID(sgid));

Acknowledgements

This project incorporates code from the following projects:

Readme

Keywords

none

Package Sidebar

Install

npm i @cedric0303/id-generator

Weekly Downloads

0

Version

0.2.1

License

MIT

Unpacked Size

107 kB

Total Files

18

Last publish

Collaborators

  • cedric0303