GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com โ€” GitHub - NeaByteLab/ForgeID: ForgeID is a scalable, verifiable, and cryptographically secure ID generator for Node.js โ€” built to evolve over time with increasing entropy. Ideal for API keys, tokens, license codes, and more.

BranchesTags
Open more actions menu

Latest commit

 

History

11 Commits
11 Commits

Folders and files

NameName
Last commit message
Last commit date
benchmark
benchmark
 
 
dist
dist
 
 
src
src
 
 
test
test
 
 
.npmignore
.npmignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
package.json
package.json
 
 

Repository files navigation

๐Ÿ” ForgeID

A scalable, secure, and verifiable unique ID generator for Node.js.
Designed to evolve with time and prevent collisions for decades โ€” even millennia.

NPM Version License Test Build


โœจ Features

  • โœ… Cryptographically signed (HMAC SHA-256)
  • ๐Ÿง† Unique and verifiable
  • ๐Ÿ•ฐ๏ธ ID length grows over time
  • ๐Ÿ” Includes timestamp + device fingerprint
  • ๐Ÿงช Built-in validation and stress testing
  • ๐Ÿฉธ Zero dependency (only uses crypto and os)
  • ๐ŸŽจ Supports prefix and formatting (dash, space)

๐Ÿš€ Installation

npm install forgeid

๐Ÿ”ง Basic Usage

const ForgeID = require('forgeid')
const forge = new ForgeID('your-secret')

const id = forge.generate()
console.log('ID:', id)

const isValid = forge.verify(id)
console.log('Verified:', isValid)

๐ŸŽจ With Prefix & Format

forge.generate('TRX')                // TRX-abc123xyz...
forge.generate('ORD', 'dash')        // ORD-abc123-def456...
forge.generate('REF', 'space')       // REF abc123 def456...

๐Ÿ“€ ID Structure

Each ID includes:

  • Random entropy from crypto.randomBytes
  • Host fingerprint (hostname + MAC)
  • Base36 timestamp (Date.now())
  • Signature from HMAC (last 10 characters)

ID format is:

[prefix-]baseContent + signature

Length increases over time:

length = baseLength + floor((currentYear - startYear) / intervalYears)

๐Ÿงช Stress Test

const forge = new ForgeID('your-secret')
forge.stressTest(1e6, 1e5)

Tests 1 million IDs for:

  • Duplicate collision
  • HMAC signature validity

๐Ÿ—’๏ธ API

new ForgeID(secret?: string, startYear?: number, baseLength?: number, intervalYears?: number)

forge.generate(prefix?: string, format?: 'dash' | 'space' | ''): string

forge.verify(id: string): boolean

forge.format(id: string, style?: 'dash' | 'space' | ''): string

forge.stressTest(total?: number, step?: number): void

โœ… Unit Testing

npm install --save-dev mocha chai
npm test

Test cases cover:

  • Raw ID generation & verification
  • Formatted and prefixed IDs
  • Tampered/invalid inputs
  • Collision-free generation (10K+)

๐Ÿง  TypeScript Support

import ForgeID from 'forgeid'

const forge = new ForgeID()
const id: string = forge.generate('TRX', 'dash')
const isValid: boolean = forge.verify(id)

Types are defined in forgeid.d.ts.


๐Ÿ“† Build

npm run build

Produces:

  • dist/forgeid.min.js โ†’ minified bundle
  • dist/forgeid.d.ts โ†’ TypeScript definitions

๐Ÿ“Š Benchmark

ForgeID can generate 1 million unique, verifiable IDs in under 25 seconds with zero duplicates.

โฑ๏ธ Time vs Keys Generated

Benchmark Time

๐Ÿง  RAM Usage vs Keys Generated

Benchmark RAM

Tested on macOS + Node.js v24.2.0, M3 CPU.


๐Ÿ“ Project Structure

ForgeID/
โ”œโ”€โ”€ src/              โ†’ main ForgeID logic (ES5)
โ”œโ”€โ”€ dist/             โ†’ minified + .d.ts output (for publishing)
โ”œโ”€โ”€ test/             โ†’ unit tests
โ”œโ”€โ”€ benchmark/        โ†’ benchmark script, JSON & PNG chart

๐Ÿ“„ License

MIT ยฉ NeaByteLab

About

ForgeID is a scalable, verifiable, and cryptographically secure ID generator for Node.js โ€” built to evolve over time with increasing entropy. Ideal for API keys, tokens, license codes, and more.

www.npmjs.com/package/forgeid

Topics

id-generatorlightweightnodejstypescriptuuid

Resources

Readme
MIT license
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Contributors

Languages

You are visitor 01402503 โ€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800ร—600. No cookies required.