Repository navigation
fix: derive 2.25 UIDs from RFC 4122 UUIDs, and document the intentional 1.0 changes - #562
Merged
Merged
Conversation
…al 1.0 changes DicomMetaDictionary.uid() built the 2.25 integer part from 39 random decimal digits, which exceeded 2^128 - 1 about 73% of the time and never carried the RFC 4122 version/variant bits, so every generated UID was formally invalid under PS3.5 Annex B.2. Ports the v2 generator: a fresh version 4 UUID (Web Crypto when available) encoded as a decimal, at most 39 digits, unskips the KNOWN GAP test in the issue-61 suite, and flips the catalog entry to green. Adds docs/INTENTIONAL_CHANGES.md recording the three review-map improvements kept on purpose: the uid() format (finding 33), the private-creator range narrowing (finding 26), and the cleanTags list correction (finding 2, not yet landed on this branch). Closes review finding 33 of the PR #512 review map. Co-Authored-By: Claude Fable 5 <[email protected]>
awatson1978
added a commit
that referenced
this pull request
Sep 30, 2026
Finding 26 landed as PR #559 and finding 33 as PR #562 (which ported the v2 uid() rather than documenting only). Master hotfixes are deferred per today's decision; finding 2's documentation pre-landed in docs/INTENTIONAL_CHANGES.md ahead of the anonymizer port. Co-Authored-By: Claude Fable 5 <[email protected]>
This was referenced Sep 30, 2026
|
🎉 This PR is included in version 1.0.0-beta.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
This closes review finding 33:
DicomMetaDictionary.uid()now derives its output from a real UUID, and a newdocs/INTENTIONAL_CHANGES.mdrecords the behavior changes 1.0 makes on purpose.The review map listed finding 33 as documentation-only, on the assumption the new generator was already in place. On this branch it wasn't —
uid()here was still the 0.x digit-concatenation version — so rather than document a change that hadn't happened, I ported the small v2 generator and wrote the documentation against real code. Failing test first: the issue-61 suite carried the UUID-derivation contract as a skipped KNOWN GAP, and I verified it fails against the old generator before applying the port.Some background. A UID is the permanent identifier DICOM gives every study, series, and image — once an archive stores one, it's never corrected. The standard (PS3.5 Annex B.2) allows the
2.25root only when the digits after it are the decimal form of a single 128-bit UUID (RFC 4122). The old generator just concatenated 39 random decimal digits, which overflows the 128-bit ceiling about 73% of the time, and even its in-range outputs never carried the version and variant bits a UUID must have. Every UID it produced was formally invalid.The ported generator makes a fresh version 4 UUID — from
globalThis.crypto.getRandomValueswhere Web Crypto exists, with a format-preservingMath.randomfallback elsewhere — and encodes it as a decimal:Consumers should note the integer part is now at most 39 digits rather than always 39, and that UIDs 0.x already generated and archived are invalid and can't be corrected after the fact. Per the review map's verdict there is deliberately no opt-out — an option to generate invalid permanent identifiers helps nobody. The issue-61 suite's KNOWN GAP test is unskipped and green, and the catalog entry flips gap → green.
The documentation half:
docs/INTENTIONAL_CHANGES.mdis a new, clearly-scoped home for the three review-map findings whose verdict was "improvement, keep and document" — this uid() change (finding 33), the private-creator range narrowing that just merged in #559 (finding 26), and thecleanTagslist correction (finding 2). The cleanTags entry is written honestly: that change hasn't landed on this branch yet and the entry says so, but it records the contract and thegetTagsNameToEmpty()opt-out recipe in advance so the anonymizer port can point here.🤖 Generated with Claude Code