UUID inspector: decode the timestamp, clock sequence and node of v6 UUIDs
Maintainer thường phản hồi trong vòng 1 ngày
@joshuaallgaier2-cmd đang làm issue này rồi.
Từ ngày 18/11/2026.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 82/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- nextjs, react, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Start in lib/uuid.ts: inspectUuid (line 83) has a v1 block at lines 113-130 that stitches the 60-bit timestamp from digits after the version nibble, then digits 9-12, then the first 8; v6 needs those three parts in reverse order, with clock sequence and node unchanged. Copy the RFC vectors into lib/__tests__/uuid-v1.test.ts first so the new test fails, reuse its zero/max/just-before-1970 cases, then update the labels in app/(tools)/uuid-generator/UuidGeneratorClient.tsx (lines 62-80) and its test at line 159, and the FAQ entry in lib/tools.ts (line 565). Done means 1EC9414C-232A-6B00-B3C8-9F6BDECED846 yields timestamp 138648505420000000, sequence 13256 and node 9f6bdeced846, non-RFC v6 is rejected, v1/v7 unchanged, and lint, test and build pass.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
#400 taught the inspector to decode v1 UUIDs, and it shows the timestamp of v7 ones. Version 6 (RFC 9562, section 5.6) sits between them: it's the v1 layout with the timestamp bits reordered so that v6 values sort by time. For a v6 UUID the inspector shows "Version 6" and "RFC 9562" and nothing else.
The RFC's own test vectors in Appendix A show the gap. C232AB00-9414-11EC-B3C8-9F6BDECED846 (v1) decodes to 2022-02-22T19:22:22.000Z, clock sequence 13256 and node 9f6bdeced846. 1EC9414C-232A-6B00-B3C8-9F6BDECED846 (v6) is the same instant, clock sequence and node, and inspectUuid returns only { ok: true, version: 6, variant: "rfc" }.
The only difference is where the 60-bit timestamp sits. For v1, inspectUuid builds it from the three hex digits after the version digit, then digits 9 to 12, then the first 8 (lib/uuid.ts, line 114). v6 stores the same three parts in the opposite order: the first 8 hex digits, then digits 9 to 12, then the three after the version digit. The clock sequence and node are in the same place as in v1.
What to do
- Decode RFC variant v6 UUIDs into the same fields v1 gets. The
v1property could become something more general that also says which version it came from, or v6 could get its own property. Either is fine as long as the tests read clearly. - Show them in the inspector with labels that name the right version. Today the first one says "UUID v1 UTC date" (
UuidGeneratorClient.tsx, line 65). - The "What does the inspector show?" FAQ in
lib/tools.ts(line 565) only mentions v7. Update it to cover v1 and v6 as well.
Where to look
lib/uuid.ts:inspectUuid(line 83) and the v1 block (lines 113 to 130)lib/__tests__/uuid-v1.test.ts, which already uses the RFC v1 vectorapp/(tools)/uuid-generator/UuidGeneratorClient.tsx(lines 62 to 80) and the v1 test inUuidGeneratorClient.test.tsx(line 159)
Acceptance criteria
-
1EC9414C-232A-6B00-B3C8-9F6BDECED846decodes to 2022-02-22T19:22:22.000Z, timestamp 138648505420000000, clock sequence 13256 and node9f6bdeced846 - A v6 UUID with a non-RFC variant isn't decoded, same as v1
- v1 and v7 results don't change
- The inspector shows the v6 fields with v6 labels
- Tests that fail on the current code
-
npm run lint,npm run testandnpm run buildpass
How to test
Put the v6 vector next to the v1 one in the unit tests and check that both give the same timestamp, clock sequence and node. The edge cases in uuid-v1.test.ts (zero and maximum timestamps, instants just before 1970) are worth repeating with the v6 layout. By hand: npm run dev, open /uuid-generator and paste the v6 vector into the inspector.
Want to work on this? Comment below and I'll assign it to you. Please take one issue at a time, branch off develop, and open your PR against develop with Closes #495 in the description.
- Ngôn ngữ chính
- TypeScript
- Star
- 1
- Fork
- 9
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 49
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của codercops/toolbelt
-
Number base converter: show what a hex or binary bit pattern means as a signed integer (`0xFFFFFFFF` is -1 in 32 bits)Có thể đã có người làm @bhushan4work đã nhận 8 ngày trước. Đang mởenhancement good first issue
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 82/100
codercops/toolbelt#494 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Regex tester: add the `v` flag, and step over emoji correctly when it's onCó thể đã có người làm @tnalbant đã nhận 8 ngày trước. Đang mởenhancement good first issue
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 82/100
codercops/toolbelt#491 · 4 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 1/100
codercops/toolbelt#101 · 24 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[admin] Quarterly content-refresh routineCó thể làm lại được @anurag629 đã nhận 147 ngày trước và không có pull request nào đang mở. Đang mởadmin-only seo
codercops/toolbelt#47 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[admin] Repurpose guides to dev communities and socialCó thể làm lại được @anurag629 đã nhận 147 ngày trước và không có pull request nào đang mở. Đang mởadmin-only seo
codercops/toolbelt#44 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của codercops/toolbelt
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Vessel9817/onion-site-template#512 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
nightly-tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
BlackBeltTechnology/pi-agent-dashboard#1256 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
approved
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
fritzprix/libr-agent#3266 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
better-auth/better-auth#13101 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày