IdCraft.js: javaScript library for generating and inspecting UUID (v4, v7) and NanoID
IdCraft.js is a JavaScript library for generating and analyzing cryptographically strong identifiers. Designed as a standalone, zero-dependency module, it provides a unified interface for UUID, NanoID, ULID standards, and advanced string entropy analysis.
Core Features
The library is built around four main pillars:
1. UUID Generation (v4 and v7)
In addition to the standard random UUID v4, IdCraft.js supports the modern v7 standard. UUID v7 identifiers incorporate a 48-bit timestamp, allowing them to be chronologically sortable, which significantly optimizes database indexing. For v4 generation, the library utilizes the native crypto.randomUUID() method whenever available. For v7, it features a bulletproof implementation with monotonicity preservation, automated 12-bit sequence overflow handling, and clock regression protection (e.g., NTP adjustments).
2. NanoID & ULID Generation
IdCraft.js enables the creation of alternative modern identifiers. It supports short, URL-friendly NanoID strings with fully customizable lengths and alphabets, including custom logic to eliminate modulo bias. Additionally, it offers native ULID (Universally Unique Lexicographically Sortable Identifier) generation, providing a 26-character, case-insensitive, base32-encoded alternative for time-ordered setups.
3. Entropy & Randomness Analysis
A sophisticated addition to the suite is the Entropy Analyzer. The library can calculate the exact cryptographic strength of any given string using Shannon Entropy formulas. It analyzes character pools, detects patterns, and measures password or token strength in bits, helping developers enforce strict security compliance.
4. Inspection and Deconstruction
A standout feature of the library is its ability to deep-scan existing UUIDs. The built-in inspector identifies the UUID version and extracts valuable embedded metadata, such as:
- The exact date and time of creation (for v1 and v7).
- Relative time elapsed from creation (e.g., "5 minutes ago").
- Hardware node information and MAC addresses (for v1).
Technical Specifications
- Security: Exclusive use of the Web Crypto API (
crypto.getRandomValues) to guarantee maximum entropy and eliminate predictability. - Zero Dependencies: No external packages, ensuring trivial integration without bloating your project's production bundle.
- Standards-Compliant: Full compliance with official RFC 9562 standards for UUIDs and community specifications for NanoID and ULID.
License and Usage
IdCraft.js is open-source software released under the GNU GPL v3.0 or later license. You can test all of its features live through our integrated suite of online tools:
Open Source & Community
IdCraft.js is fully open-source and hosted on GitHub. We believe in building transparent, secure, and community-driven software. Developers from all around the world are welcome to audit the code, report bugs, suggest new algorithms, or contribute to its development.
Whether you are building a client-side web application or a server-side Node.js microservice, integrating IdCraft.js is straightforward. You can clone the repository, download the production-ready build files, or participate in the project by submitting Pull Requests (PRs).
Get Started Now: View the source code, star the project, and contribute to the official repository on GitHub: github.com/kritikov/IdCraft


