Cryptographically Secure
Uses Node.js crypto.randomBytes() for true randomness. 72 bits of entropy ensures collision resistance.
Generate unique, human-readable IDs with optional prefixes. Perfect for databases, APIs, and distributed systems.
npm install @aexoo-ai/spark-idpnpm add @aexoo-ai/spark-idyarn add @aexoo-ai/spark-idimport { 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# 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 3Choose your path to get started with Spark-ID: