Repository navigation
docs: fix stale v1, v6, v7 and CLI details in README - #991
Merged
Merged
Conversation
- options.nsecs is a count of 100-nanosecond intervals, not nanoseconds (nsecs: 10000 gives the same UUID as msecs + 1). - v1() no longer throws when more than 10M UUIDs/sec are requested. Since uuid@11 the node is reset on nsecs overflow instead. - The v6() options example passed `node` as a plain array, which fails to type-check against Version1Options (Uint8Array). - The v7() description said "(random)"; v7 is the Unix Epoch time-based version, as the API summary already says. - `uuid --help` output was missing the `uuid v6` line. README.md is regenerated with `npm run docs`. The README_js.md Node support paragraph is synced from README.md so regenerating keeps the current wording. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NQDmA3mwGfL83pbg9WQ6ey
broofa
approved these changes
Nov 1, 2026
broofa
left a comment
Member
There was a problem hiding this comment.
Good catches. Thanks for the contribution!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The repo's PR template only asks for benchmark results on considerable changes. This is a docs-only change, so I did not run the benchmark.
I checked the README against the current code on
mainand found five places where it no longer matches. I made the edits inREADME_js.mdand regeneratedREADME.mdwithnpm run docs, as CONTRIBUTING.md asks.Changes
v1()options.nsecsunit. The table said it is a number of nanoseconds, 0-10,000. The code treats it as 100-nanosecond intervals (t = msecs * 10000 + nsecs). I checked this by running:Both calls return the same UUID, so 10,000 is a full millisecond. I changed the text to "100-nanosecond intervals, should be 0-9,999".
v1()_throws_row. The table said v1 throws if more than 10M UUIDs/sec are requested. That stopped being true in uuid@11 (see the comment inupdateV1State: it now resets the node onnsecsoverflow). I stubbedDate.nowto a fixed value and calledv1()20,001 times. Nothing threw. I removed the row.v6()options example. It passednodeas a plain array.Version1Options.nodeis aUint8Array, so the example does not type-check:I changed it to
Uint8Array.of(...), the same as thev1()example. With that changetsc --strictpasses, and the generated output in the README stays the same.v7()description. It said "Create an RFC version 7 (random) UUID". v7 is the Unix Epoch time-based version, and the API summary table already says so. I made the heading match.uuid --helpoutput. The README copy did not have theuuid v6line.node dist-node/bin/uuid --helpprints it, anduuid v6works.Other diffs from regenerating
uuidv6()example output changed from...-504d...to...-514d.... That example uses the seeded fake RNG from the top ofREADME_js.md. The new value has the multicast bit set on the random node, which is what fix(v1): set the multicast bit on v1Bytes's own randomly-generated node #973 changed. The README had not been regenerated since then.README.md(b9ed7c7). I copied that wording intoREADME_js.mdso thatnpm run docskeeps it. The only difference inREADME.mdis one double space that became a single space, which Prettier also asks for.Checks
npm run docsruns without errorsnpm test: 84 passed, 0 failednpx prettier --check README_js.mdpasses