ai/nanoid

A tiny (118 bytes), secure, URL-friendly, unique string ID generator for JavaScript

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 45 minutes ago
Added to GitGenius on September 2nd, 2026
Created on August 5th, 2017
Open Issues & Pull Requests: 0 (+0)
GitHub issues: Enabled
Number of forks: 876
Total Stargazers: 26,961 (+0)
Total Subscribers: 162 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 0.4 hours
Mean response time: 4.6 hours
90th percentile: 24.4 hours
Tracked items: 38

How this project is maintained

Around half of the issues opened in the past year never receive a reply. Only 14% of issues opened in the past year have been closed. Three people close 97% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 0
New in 7 days: 0
Closed in 7 days: 0
Avg open age: N/A days
Stale 30+ days: 0
Stale 90+ days: 0

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

No label distribution available yet.

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

Nano ID is a tiny, secure, URL-friendly unique string ID generator for JavaScript.

The tool solves the problem of generating collision-resistant identifiers in web applications. It addresses shortcomings in UUID v4 by using a larger alphabet of URL-safe characters (A-Za-z0-9_-) to pack the same cryptographic entropy into shorter strings—21 characters instead of 36—while maintaining equivalent collision probability. It uses hardware-backed random generation via the crypto module in Node.js and Web Crypto API in browsers, ensuring unpredictability and uniform distribution across the alphabet to resist brute-force attacks.

Developers should choose Nano ID when they need compact, URL-safe identifiers for databases, APIs, or distributed systems where shorter strings reduce storage and transmission overhead. It suits any JavaScript environment from Node.js to browsers to edge runtimes. The README explicitly compares it to UUID v4, noting that Nano ID achieves similar security properties with 50% better performance and shorter output. The tool offers customization through custom alphabets and sizes, and a non-secure variant for cases where cryptographic strength is unnecessary.

The project maintains strict size control through automated tooling, with the minified and compressed bundle held to 118 bytes. Development activity shows consistent attention to security practices, including documented handling of potential vulnerabilities through a responsible disclosure process. The codebase is well-commented to explain implementation details and security considerations. Nano ID has been ported to multiple programming languages, indicating sustained cross-platform adoption and maintenance.