@lowdep/uuid-tool
v1.0.0
Published
Generate and inspect UUIDs — v4 random, v7 time-ordered, v3/v5 namespaced, plus decode version & timestamp — zero dependencies
Maintainers
Readme
uuid-tool
Generate and inspect UUIDs from the terminal. Supports v4 (random), v7 (time-ordered — best for database keys), v3/v5 (deterministic/namespaced), plus an inspect mode that decodes the version, variant, and embedded timestamp. Zero dependencies — uses only Node's built-in crypto.
uuidgen only does v1/v4 and isn't on Windows by default. The uuid npm package isn't a CLI. This is one file that does it all.
Install
npm install -g uuid-toolOr without installing:
npx uuid-tool v4Usage
uuid-tool v4 # Random UUID
uuid-tool v7 # Time-ordered UUID (great for DB keys)
uuid-tool v7 -n 5 # Five of them
uuid-tool v5 example.com --namespace dns # Deterministic
uuid-tool inspect 018f6c8e-... # Decode version + timestamp
uuid-tool v4 -n 1000 --no-hyphens # Bulk, no hyphens
uuid-tool nil # 00000000-0000-0000-0000-000000000000Which Version Should I Use?
| Version | Use it for | |---|---| | v4 | General-purpose random IDs. The safe default. | | v7 | Database primary keys. Time-ordered, so inserts stay sequential and indexes don't fragment — but still globally unique. | | v5 | Deterministic IDs: same name + namespace always yields the same UUID (SHA-1). | | v3 | Like v5 but MD5 (legacy). |
Inspect / Decode
$ uuid-tool inspect 018f6c8e-7b1a-7c3d-9f2e-1a2b3c4d5e6f
uuid-tool 018f6c8e-7b1a-7c3d-9f2e-1a2b3c4d5e6f
Version v7
Variant RFC 4122/9562 (10x)
Timestamp 2024-05-20T10:13:20.000Z (3s ago)For v7 and v1 UUIDs the embedded timestamp is extracted and shown as both ISO time and a relative age — handy for telling when a record was created straight from its ID.
Namespaces (v3/v5)
Built-in: dns, url, oid, x500. Or pass any UUID as a custom namespace:
uuid-tool v5 "[email protected]" --namespace url
uuid-tool v5 mykey --namespace 6ba7b810-9dad-11d1-80b4-00c04fd430c8Options
| Flag | Description |
|---|---|
| -n, --count <N> | Generate N UUIDs (v4/v7) |
| --namespace <ns> | dns | url | oid | x500 | <uuid> |
| --upper | Uppercase output |
| --no-hyphens | Strip hyphens |
| --json | JSON output |
License
MIT
Keywords
uuid generator · uuidv4 · uuidv7 · uuidv5 · generate uuid · guid generator · uuidgen alternative · time-ordered uuid · zero dependencies · cli
Built to solve, shared to help — Rushabh Shah 🛠️✨
One of 40+ zero-dependency developer CLI tools — no node_modules, ever.
