-
Notifications
You must be signed in to change notification settings - Fork 3
Entropy
If you use the default options, even if you generate 1 billion IDs per second, you'd need hundreds of millions of years to have a meaningful chance of a collision. Sounds unbelievable? Letβs do the math:
ID Format: xxxxxxxx-xxxxxxxx-xxxxxxxx-xxxxxxxx
Character Set: 36 characters (0β9, aβz)
Length: 32 characters
Randomness Source: Cryptographically secure (crypto.randomBytes)
36^32 β 6.334 Γ 10^49
- IDs per second: 1,000,000,000
- Seconds per year: 60 Γ 60 Γ 24 Γ 365 = 31,536,000
- IDs per year: 1 Γ 10^9 Γ 31,536,000 = 3.1536 Γ 10^16
β(36^32) = 36^16 β 7.961 Γ 10^24
7.961 Γ 10^24 Γ· 3.1536 Γ 10^16 β 252,443,706 years
Using cryptographically secure randomness, your custom 32-character base36 ID format would take ~252 million years of generating 1 billion IDs per second to reach a 50% chance of collision.
This makes it extremely safe for any real-world application. Offers greater collision resistance than UUID v4 (~82 thousand years of generating 1 billion IDs per second) thanks to a larger entropy space (6.334 Γ 10^49), powered by cryptographically secure randomness.
π unique-custom-id β most customizable ID generator you'll ever meet
π See our contributing guide for guidelines on how to contribute
π¬ Join the conversation on discussions
πͺͺ Licensed under MIT β free to fork, remix, and build upon
π Maintained by @calebephrem β contributions welcome!
β¨ Fork it. Tweak it. Make it yours.
- π Home
- π οΈ Usage
- π οΈ How To Use UCID
- π¦ Installation
- β Importing
- π Generate Simple ID
- π§© Configuration Options
- π§° Predefined Formats
- ποΈ Predefined Formats
- π§ Format Aliases
- π Format List
- π§ͺ Usage Examples
- β Remember
- 𧬠CLI
- π UCID CLI
- π Quick Start
- π CLI Options
- π§ͺ Examples
- πͺ£ Entropy Space