Skip to content

Spark-IDCryptographically secure, URL-safe ID generator

Generate unique, human-readable IDs with optional prefixes. Perfect for databases, APIs, and distributed systems.

Quick Start

bash
npm install @aexoo-ai/spark-id
bash
pnpm add @aexoo-ai/spark-id
bash
yarn add @aexoo-ai/spark-id
typescript
import { generateId, createId, isValidId, configure } from '@aexoo-ai/spark-id';

// Configure defaults (optional)
configure({ case: 'upper', separator: '_' });

// Generate a simple ID
const id = generateId(); // "YBNDRFG8EJKMCPQXOT1UWISZA345H769"

// Generate with prefix
const userId = generateId('USER'); // "USER_YBNDRFG8EJKMCPQXOT1UWISZA345H769"

// Generate with custom config
const customId = generateId('TXN', { case: 'lower', separator: '-' }); // "txn-YBNDRFG8EJKMCPQXOT1UWISZA345H769"

// Validate an ID
isValidId(userId); // true

CLI Usage

bash
# Generate IDs from command line
npx @aexoo-ai/spark-id -p USER -c 5

# Or install globally
npm install -g @aexoo-ai/spark-id
spark-id -p TXN -c 3

Live Demo

Generate IDs

Generate with Prefix

Validate ID

Why Spark-ID?

🚀 Performance

  • Generates 1000+ IDs per second
  • Zero dependencies
  • Lightweight bundle size

🔒 Security

  • Cryptographically secure random generation
  • 72 bits of entropy
  • Collision-resistant

🎯 Developer Experience

  • Simple, intuitive API
  • Full TypeScript support
  • Comprehensive validation
  • CLI tool included

🌍 Production Ready

  • URL-safe encoding
  • Human-readable format
  • Prefix support for organization
  • Battle-tested in production

Get Started

Choose your path to get started with Spark-ID:

Released under the MIT License.