npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

idmint

v1.1.1

Published

Enterprise-grade, collision-resistant unique ID generator

Readme

idmint

npm npm license

Simple, secure, and scalable unique ID generator for modern applications

idmint is a lightweight, TypeScript-friendly unique ID generator designed for high-traffic frontend and backend applications.
It uses cryptographically secure randomness to generate collision-resistant IDs without any database, server coordination, or external dependency.

❤️ Why idmint?

  • Most ID libraries silently accept invalid input.
  • In production systems, silent bugs are worse than crashes.
  • idmint fails fast, fails clearly, and fails safely.

idmint focuses on clarity, flexibility, and enterprise readiness while remaining lightweight and easy to use.


✨ Features

  • 🔐 Cryptographically secure IDs (Node.js crypto)
  • Extremely low collision probability (safe for millions to billions of IDs)
  • 🧩 Optional size parameter (flexible length)
  • 🕒 Time-based sortable IDs
  • 🏷 Prefix support
  • 📦 Zero runtime dependencies
  • 🟦 Written in TypeScript
  • 🚀 Works in high-traffic & distributed systems

📦 Installation

npm install idmint

🚀 Usage

Generate a default ID

import { generateId } from "idmint";

const id = generateId();
console.log(id);
// → "V1StGXR8_Z5jdHi6B-myT"

Generate ID with custom size

generateId(7);    // shorter ID
generateId(32);   // longer, ultra-safe ID

ℹ️ Allowed size range: 4 to 64

Generate ID with prefix

import { generateIdWithPrefix } from "idmint";

const id = generateIdWithPrefix("user", 10);
console.log(id);
// → "user_K9dLx2PqA"

Useful for:

  • User IDs
  • Order IDs
  • Entity-based identifiers

Generate time-based sortable ID

import { timeBasedId } from "idmint";

const id = timeBasedId();
console.log(id);
// → "lq9z3a8c4kH9dP2"

These IDs naturally sort by creation time, which is useful for:

  • Logs
  • Tables
  • Pagination
  • Short URLs
  • Analytics & tracking

Preset generators

import { idmint } from "idmint";

idmint.short();    // 8 characters
idmint.medium();   // 21 characters (default, recommended)
idmint.long();     // 32 characters

🚫 Error handling

All public APIs validate input and throw descriptive errors. This is intentional to avoid silent failures in production.

🔒 How uniqueness is ensured

idmint does not store IDs in any database.

Uniqueness is achieved through:

  • Cryptographically secure random bytes
  • High-entropy alphabet (64 URL-safe characters)
  • Configurable ID length

Collision probability

With default settings:

  • Alphabet size: 64
  • Length: 21 characters
  • Entropy: 126 bits

This makes collision probability astronomically low, even with millions or billions of generated IDs.

🧠 When to use idmint

  • React keys
  • Short URLs
  • Client-side ID generation
  • Temporary IDs before database insert
  • Logs & request tracking
  • Distributed systems (no coordination required)

📄 License

MIT