di-short-mongo-id

JSON →
library 1.0.1 ·javascript
verified Jun 5, 2026

Generates short, URL-friendly IDs from MongoDB ObjectIds by extracting timestamp and counter bits (77 bits total). The generated IDs are one-way (cannot be reversed to original ObjectId) but are reasonably unique. Version 1.0.1 is the only version; package is small and has no dependencies. Unlike other short ID libraries (e.g., nanoid, uuid), this is specifically designed for MongoDB ObjectIds and does not generate random IDs.